kripken/emscripten — pull request #1743 by fadams (2013-10-27 20:40:18+00:00)
Title: add support for node.js to act as a socket client

As per issue https://github.com/kripken/emscripten/issues/1738

I've modified library_sockfs to use ws.WebSocket when the client is running in node.js
modified library_browser.js to use a timeout instead of requestAnimationFrame if window doesn't exist
added test run with ./runner.py nodejs_sockets.test_sockets_echo - needed to add an additional nodejs_sockets class as the sockets class is derived from BrowserCore and this fix is explicitly for node.js not the browser.

Note that Websockify doesn't seem to like ws.WebSocket clients TODO check if this is a ws.WebSocket issue or Websockify issue, but compiled servers that also use ws.WebSocket work fine.