Search Unity

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

Discussion in 'Netcode for GameObjects' started by erikScantamburlo, Aug 31, 2023.

  1. erikScantamburlo


    Jan 11, 2023
    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:

    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.

    Attached Files:

  2. CodeSmile


    Apr 10, 2014
    Hmmm ... a SuccessException. o_O

    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". ;)

    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?