This may not be trivial because WebSockets are implemented on top of TCP, and require(?) a client-server model, while many multiplayer games use UDP and a peer-to-peer model.
So don't be surprised if you need to rip out and rewrite your entire networking code ;) Emscripten's socket API wrapper may help a bit when you're currently only using TCP-based sockets and a client/server model, but there are still a few important differences to native sockets (mainly that emscripten sockets work in non-blocking mode at all times). Your best bet may be replacing the lower-level networking code with a library like ENet or HumbleNet: https://hacks.mozilla.org/2017/06/introducing-humblenet-a-cross-platform-networking-library-that-works-in-the-browser/ https://github.com/mnaamani/enet-emscripten But I don't know the current state of either of those libraries. Cheers, -Floh. On Tuesday, 7 May 2019 00:35:25 UTC+2, [email protected] wrote: > > Hey all, we've ported an Unreal Engine 4 game to the web, and it works > great in solo mode (you can play against the bot). But when trying to > search for or join a dedicated server in the main menu GUI, we encounter an > error page which I've attached for reference. We believe it's because we > haven't set up WebSockets for our game, but are unsure of how to properly > implement this. Any input would be really appreciated. Thanks! > -- 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]. To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/407191b3-c7df-4007-80eb-f8d643c64b48%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
