Skip to content

Instantly share code, notes, and snippets.

@btucker
Forked from scripting/helpRequest.md
Created February 15, 2016 13:09
Show Gist options
  • Save btucker/1a06d5a9f4cf222d8a0a to your computer and use it in GitHub Desktop.
Save btucker/1a06d5a9f4cf222d8a0a to your computer and use it in GitHub Desktop.

I need a way to write WebSocket client code that runs on a server in Node.js.

What it must do: Exactly what this browser-based app does, only running on a server, without the UI stuff.

https://github.com/scripting/1999client/blob/master/code.js#L133

It would make so much sense if Node implemented exactly the browser API for WebSockets, native. So much of Node works that way. But this is one of those times when it doesn't.

There are a few toolkits that do WebSockets on the server. But there isn't simple clean sample code that I've been able to convert to this application. I tried! :-)

Any help much appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment