Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug WebGL ArgumentException: IPC network driver can only handle loopback addresses

Discussion in 'Unity Transport' started by avac_c, Jun 20, 2023.

  1. avac_c

    avac_c

    Joined:
    Jun 3, 2023
    Posts:
    1
    Code (CSharp):
    1. Allocation allocation = await AllocateRelay();NetworkManager.Singleton.GetComponent<UnityTransport>().SetRelayServerData(new RelayServerData(allocation, "dtls"));
    2. NetworkManager.Singleton.StartHost();
    Windows runs normally, but when switching to WebGL, an error occurs.

    Code (CSharp):
    1. ArgumentException: IPC network driver can only handle loopback addresses
    2. Unity.Networking.Transport.IPCNetworkInterface.CreateInterfaceEndPoint (Unity.Networking.Transport.NetworkEndPoint address, Unity.Networking.Transport.NetworkInterfaceEndPoint& endpoint) (at Library/PackageCache/com.unity.transport@1.3.1/Runtime/IPCNetworkInterface.cs:47)
    3. Unity.Networking.Transport.Relay.RelayNetworkProtocol.Bind (Unity.Networking.Transport.INetworkInterface networkInterface, Unity.Networking.Transport.NetworkInterfaceEndPoint& localEndPoint) (at Library/PackageCache/com.unity.transport@1.3.1/Runtime/Relay/RelayNetworkProtocol.cs:237)
    4. Unity.Networking.Transport.NetworkDriver.Bind (Unity.Networking.Transport.NetworkEndPoint endpoint) (at Library/PackageCache/com.unity.transport@1.3.1/Runtime/NetworkDriver.cs:988)
    5. Unity.Netcode.Transports.UTP.UnityTransport.ServerBindAndListen (Unity.Networking.Transport.NetworkEndPoint endPoint) (at Library/PackageCache/com.unity.netcode.gameobjects@1.2.0/Runtime/Transports/UTP/UnityTransport.cs:529)
    6. Unity.Netcode.Transports.UTP.UnityTransport.StartRelayServer () (at Library/PackageCache/com.unity.netcode.gameobjects@1.2.0/Runtime/Transports/UTP/UnityTransport.cs:675)
    7. Unity.Netcode.Transports.UTP.UnityTransport.StartServer () (at Library/PackageCache/com.unity.netcode.gameobjects@1.2.0/Runtime/Transports/UTP/UnityTransport.cs:1316)
    8. Unity.Netcode.NetworkManager.StartHost () (at Library/PackageCache/com.unity.netcode.gameobjects@1.2.0/Runtime/Core/NetworkManager.cs:1162)
    9. KitchenGameMultiplayer.StartHost () (at Assets/Scripts/KitchenGameMultiplayer.cs:105)
    10. KitchenGameLobby.CreateLobby (System.String lobbyName, System.Boolean isPrivate) (at Assets/Scripts/KitchenGameLobby.cs:289)
    11. System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0 (System.Object state) (at <88e4733ac7bc4ae1b496735e6b83bbd3>:0)
    12. UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () (at <28d694a2939e4826992577f826717d3b>:0)
    13. UnityEngine.UnitySynchronizationContext.Exec () (at <28d694a2939e4826992577f826717d3b>:0)
    14. UnityEngine.UnitySynchronizationContext.ExecuteTasks () (at <28d694a2939e4826992577f826717d3b>:0)
    What could be the cause of this issue and how can it be resolved?
     
  2. simon-lemay-unity

    simon-lemay-unity

    Unity Technologies

    Joined:
    Jul 19, 2021
    Posts:
    416
    You'll need to use "wss" instead of "dtls" as the connection type. You'll also need to make sure you install version 2.X of the
    com.unity.transport
    package (latest is 2.0.2) and check the "Use WebSockets" checkbox under the Unity Transport component in the inspector.
     
    AndreaGalet likes this.
  3. dingaloo12

    dingaloo12

    Joined:
    Jun 30, 2020
    Posts:
    12
    Hey, thanks for that tip, however "use websockets" doesn't seem to be an option under the unity transport component
     

    Attached Files:

  4. simon-lemay-unity

    simon-lemay-unity

    Unity Technologies

    Joined:
    Jul 19, 2021
    Posts:
    416
    Do you have Unity Transport 2.X installed? For this option to appear, package
    com.unity.transport
    needs to be at least version 2.0 (latest is 2.0.2). Furthermore, this package version is only supported on Unity 2022.2 or later.
     
    AndreaGalet, AlonMixed and Tew1816 like this.