Description
The WebGL host itself is fine: ISession.State == Connected, ISession.Network.State == Started,
NetworkManager.IsListening == true, and it is correctly a client of the CMB service
(isServer=False, isClient=True, UseCMBService=True).
The joining peer opens the relay WebSocket and exchanges frames in both
directions once per second for the whole attempt, but NetworkManager.IsConnectedClient never
becomes true. After MaxConnectAttempts NGO shuts the client down and the SDK reports
SessionError.NetworkManagerStartFailed.
The same WebGL build joins an Editor-hosted session without any problem, and the same code works
in Multiplayer Play Mode. Only sessions hosted by a WebGL build refuse peers.
Reproduce Steps
- Configure per Distributed authority and WebGL quickstart:
DistributedAuthorityTransport on the
NetworkManager, Use Web Sockets enabled.
- Host:
var options = new SessionOptions { MaxPlayers = 4 }
.WithDistributedAuthorityNetwork()
.WithNetworkOptions(new NetworkOptions { RelayProtocol = RelayProtocol.WSS });
ISession session = await MultiplayerService.Instance.CreateSessionAsync(options);
- Build for WebGL (release), open in localhost browser A, create the session, note
session.Code.
- Open the same build in localhost browser B.
- Join from B:
var joinOptions = new JoinSessionOptions()
.WithNetworkOptions(new NetworkOptions { RelayProtocol = RelayProtocol.WSS });
ISession session = await MultiplayerService.Instance.JoinSessionByCodeAsync(code, joinOptions);
// never returns
Same result with JoinSessionByIdAsync and MatchmakeSessionAsync(QuickJoinOptions, SessionOptions).
Actual Outcome
JoinSessionByCodeAsync never returns. The lobby join itself succeeds — a second attempt from the
same client returns SessionException: player is already a member of the lobby.
Joining client:
Unity Transport: Connecting to wss://4296532389410631913.us-central1.relay.uf.unity3d.com:37011/. no Netcode connection
[Multiplayer]: GameObjectsNetcodeNetworkHandler.StopAsync: Failed to stop session: session was never started.
AddingSessionFailed — NetworkManagerStartFailed: Failed to start the network manager
Expected Outcome
The peer connects and JoinSessionByCodeAsync returns a session with IsConnectedClient == true,
as it does when the host is the Editor.
Environment
- OS: macOS
- Unity Version: 6000.5.4f1
- Netcode Version: 2.13.1,
com.unity.services.multiplayer 2.2.4, com.unity.transport 6.5.0
- Netcode Topology: Distributed Authority
- Unitask: 2.5.11
Additional Context
| SessionOwner | client | Result |
| Editor | Editor (Multiplayer Play Mode) | works |
| Editor | WebGL build | works |
| WebGL build | Editor | fails |
| WebGL build | WebGL build | fails |
Description
The WebGL host itself is fine:
ISession.State == Connected,ISession.Network.State == Started,NetworkManager.IsListening == true, and it is correctly a client of the CMB service(
isServer=False,isClient=True,UseCMBService=True).The joining peer opens the relay WebSocket and exchanges frames in both
directions once per second for the whole attempt, but
NetworkManager.IsConnectedClientneverbecomes true. After
MaxConnectAttemptsNGO shuts the client down and the SDK reportsSessionError.NetworkManagerStartFailed.The same WebGL build joins an Editor-hosted session without any problem, and the same code works
in Multiplayer Play Mode. Only sessions hosted by a WebGL build refuse peers.
Reproduce Steps
DistributedAuthorityTransporton theNetworkManager, Use Web Sockets enabled.session.Code.Same result with
JoinSessionByIdAsyncandMatchmakeSessionAsync(QuickJoinOptions, SessionOptions).Actual Outcome
JoinSessionByCodeAsyncnever returns. The lobby join itself succeeds — a second attempt from thesame client returns
SessionException: player is already a member of the lobby.Joining client:
Expected Outcome
The peer connects and
JoinSessionByCodeAsyncreturns a session withIsConnectedClient == true,as it does when the host is the Editor.
Environment
com.unity.services.multiplayer2.2.4,com.unity.transport6.5.0Additional Context
| SessionOwner | client | Result |
| Editor | Editor (Multiplayer Play Mode) | works |
| Editor | WebGL build | works |
| WebGL build | Editor | fails |
| WebGL build | WebGL build | fails |