The best thing is to ask inolen, who wrote most of the sockets code. I'm not sure he reads the mailing list, but is available on github and irc with that nick.
One thing I know though is that he did a lot of work to make server stuff work as well. You should be able to take a server cpp file, build it to JS, and run it in node as a websockets server. See test_sockets.py for examples. - Alon On Fri, Jun 27, 2014 at 6:08 AM, Karsten Pedersen <[email protected]> wrote: > Hi, > > For a project of mine (A reimplementation of the Unity 4.x API - > http://www.mutiny3d.org) I have been looking at ways to use sockets in > ways as similar as possible to BSD / UNIX sockets. I understand that due to > security limitations in a web browser it is not possible to listen for > connections. I also understand that the connections use the websocket > protocol rather than raw tcp / udp packets. > > I can deal with the above differences because so far some excellent work > has been put into the clientside sockets API and it does seem to work. > However, what I find most fiddly is developing the serverside websocket > server (and integrating with my existing code) or using solutions such as > wsproxy. Unless I am missing something, I have noticed that websocket > server libraries in general are often very overengineered. > > So I perhaps propose the idea that listen(2) and accept(2) could be > implemented (and work when run via node.js rather than a web browser) but > they actually provide the websocket protocol behind the scenes rather than > the traditional raw protocol. > > Perhaps this idea has already been implemented? If not and the idea could > potentially be useful for others (perhaps even inclusion upstream), I am > more than happy to give it a shot to implement myself. My Javascript code > is horrendous but I am hoping I can get by with my C or C++ instead. > > Best regards, > > Karsten > > -- > You received this message because you are subscribed to the Google Groups > "emscripten-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
