Yes here :) We have recently built a little proof-of-concept client/server prototype where natively compiled clients connect through a TCP socket, and emscripten clients connect through WebSocket, both compiled from the same C++ source.
The game server was written in golang, and we used https://github.com/gorilla/websocket as websocket proxy layer in the game server process, the game server opened one normal TCP port with Golang's native TCP support, and a separate WebSocket port next to it, managed by Gorilla. On the client side I wrote a minimal client socket wrapper which uses non-blocking sockets across all platforms (emscripten's socket wrapper is generally non-blocking). Unfortunately the whole project is closed source, but here's a gist with the (very quick'n'dirty) NetClient implementation which has all the interesting client-side stuff in it: https://gist.github.com/floooh/b4d25d0e11ef2be91dd19cb974bcc7a6 We created 3 client types, one written in Unity exported to asm.js, one with Oryol (https://github.com/floooh/oryol), and one in Typescript with babylon.js (http://babylonjs.com/). The Unity client was about 4.9 MByte (theoretically we could have get this down to around 3.5 MB because the Unity physics code slipped in because of a stabbing test against the ground), the Oryol client around 410 KBytes, and the Typescript client around 310 KBytes (mostly the minimized babylon.js blob), all sizes are compressed sizes. Fun project all in all :) Cheers, -Floh. Am Mittwoch, 18. Januar 2017 15:48:22 UTC+1 schrieb Thomas Arnbjerg: > > Has anyone succeded in connecting an Emscripten socket client against a > libWebsocket based server? > -- 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.
