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!
Can you use the Google Closure lib? https://developers.google.com/closure/library/?
I try to do my JavaScript in ClojureScript (which compiles down into JS using Closure) which bundles that library in by default to handle a bunch of stuff when needed.