Why do i get this Socket Exception in my WebGL build with Netcode for Game Objects?

Hello everyone,
i’m trying to test a simple multiplayer scene made with Netcode For GameObjects v. 1.5.2 and WebSocket Transport 2.0.0 imported form this git url: multiplayer-community-contributions/Transports/com.community.netcode.transport.websocket at main · Unity-Technologies/multiplayer-community-contributions · GitHub

If I test it in editor all works as intended and I can start as a host, scene works as expected.
But when I build it I get this error in browser console:
"SocketException: Success
at System.Net.Sockets.Socket…ctor (System.Net.Sockets.AddressFamily addressFamily, System.Net.Sockets.SocketType socketType, System.Net.Sockets.ProtocolType protocolType) [0x00000] in <00000000000000000000000000000000>:0 "

why does this happen?
I tryed to disable windows defender firewall too but nothing changes.
I’m testing also on other built projects with the same netcode version and same transport version and i get the same error.

Hmmm … a SuccessException. :eyes:

Have you tried building a development / debug mode build with full stacktrace (see Player Settings)? You may get more detailed info on this. Hopefully it will be more informative than “successfully failed”. :wink:

I have not seen that “Path” setting in the WebSocket transport. You entered “/netcode” which may or may not be correct. Just a stomach feeling, maybe check the documents on that again. I sense this is supposed to indicate the app is deployed to “https://the.webserver.domain/netcode” - is that so?

Have you solved it? I have same issue

If you use Netcode 1.8 or later WebSockets support is integrated and only needs to be enabled in the NetworkManager / UnityTransport Inspector.

Oh, hmm … did I overlook this in the original post? :sweat_smile:

If the intention is to HOST a game in WebGL, this is not possible!
WebSockets does not allow incoming connections, it is a client-only transport due to browser security restrictions.

1 Like