#Using bevy-renet on wasm32

5 messages · Page 1 of 1 (latest)

sharp sigil
#

I am trying to move my multiplayer bevy client to the web using webassembly. The server will still run natively, only the client should work from inside a browser.
When just running the same code in wasm I get an error on the line let socket = UdpSocket::bind("127.0.0.1:0").unwrap(); which makes sense, since opening raw sockets is not supported in wasm.
Is there a way to use bevy-renet with websockets instead? If so, are there any examples for this?
I imagine that this will lead to a bunch of problems, since the server then also needs to accepts websocket connections?
Is the idea of having native and webclients even feasible with bevy?
I guess it would be possible to run the wasm binary "natively" using something like wasmtime, correct?

Or is there already another library which magically solves all these problems?
Looking forward to your insights ;)

night echo
sharp sigil
#

Thank you very much for the quick answer and the information provided :)
Great to see that it will be possible soon™

surreal juniper
#

is there some kind of UDP simulation layer because I thought wasm couldn't do udp? I might be off here.

#

in a browser context at least*