paradust7 / minetest-wasm

Experimental Minetest build for WebAssembly/Emscripten
https://minetest.dustlabs.io/
MIT License
99 stars 23 forks source link

BUG Report: Unable to join server with custom service #7

Closed lychees closed 2 years ago

lychees commented 2 years ago

I guess it is probablly related with https://github.com/paradust7/minetest-wasm/issues/6, but I am not sure.

Now, we are binding a address with the ip, mt.kuso.io:30000, It now shows time out when connecting. (everything is fine in native minetest)

paradust7 commented 2 years ago

Web pages can't use normal TCP or UDP sockets. They can only connect using websockets. So I'm running a websocket proxy:

https://github.com/paradust7/minetest/blob/webport/src/mainloop.cpp#L82

My proxy only allows connections to minetest servers that are listed in the public server list. You could make your own proxy server if you wanted. The interface is here:

https://github.com/paradust7/webshims/blob/main/src/emsocket/proxy.js#L35