It look like emscripten emulates sockets with websockets, so yes/no. You’ll need a server that can handle websockets and I have no idea how you’d go about setting that up or how to interface with it. Also, the native socket code would need to be extensively rewritten – this thread is enough to scare me off for now:
https://github.com/kripken/emscripten/issues/3611
Its the kind of thing I think we’d need some real expert help with.
If yer bored, give the new desktop sockets in develop branch a try. I came up with quite a few tweaks and fixes today and I think it’s mostly working now.