Test a session
Test with two game instances: a host and a remote client. Both instances can run on the same computer. This test checks the relay connection and your game’s networking setup. A host-only test does not exercise a remote client’s connection.
Before you start, configure the NGO transport, Fish-Networking transport, or Mirror transport. Use an ephemeral room for the first test to exclude host promotion from the connection flow.
Connect locally
Section titled “Connect locally”-
Start one relay process.
Set both game instances to use relay address
127.0.0.1, UDP port7770, and the relay’s connection key. If you changed the relay port, use that port instead. -
Start the host instance.
Start host mode in your networking framework. Before you read
GetRoomCode(), wait for the transport’s server connection to reach its started state:- In NGO, check
transport.ServerSocket.SocketState == RelaySocketState.Started. - In Fish-Networking, wait for the server’s
OnServerConnectionStateevent withConnectionState == LocalConnectionState.Started. - In Mirror, check
transport.ServerSocket.SocketState == RelaySocketState.Started.NetworkServer.activedoes not confirm relay registration.
A successful start call begins a connection attempt. It does not confirm that room registration has finished.
- In NGO, check
-
Join from the second instance.
Set the client’s room code to the code from the host’s transport. Then start client mode. Both instances must use the same relay process.
-
Check game traffic.
Use your framework’s connection events to confirm that the host sees the joining player. Perform an action that your game synchronises, such as moving a networked object. Connecting to a room does not confirm that you configured networked objects and remote procedure calls (RPCs) correctly.
-
Stop the host.
Shut down the host through your networking framework. The relay removes the ephemeral room and disconnects the remote client. Confirm that the old code no longer accepts joins. If you start another host, the relay creates a new room with a new code.
Inspect the room
Section titled “Inspect the room”While the host is running, you can inspect its room through the HTTP API. If HTTP is enabled and you have the admin token, send the following request before you stop the host:
curl http://127.0.0.1:7771/rooms \ -H "Authorization: Bearer $BLITZ_RELAY_HTTP_ADMIN_TOKEN"For an active host, the room snapshot contains hasHost: true. connectedClientCount excludes the relay host connection but includes Fish-Networking’s local host client. NGO and Mirror handle their local host clients internally, so the relay does not count them.
GET /health checks only the HTTP listener. To test UDP end to end, join a room and exchange game traffic.
Move to another machine
Section titled “Move to another machine”In both game instances, replace 127.0.0.1 with the remote relay’s reachable IP address or hostname. The address 127.0.0.1 always refers to the device running the game, not to your development computer.
Allow inbound UDP on the relay port in the machine’s firewall and your hosting provider’s firewall. If the relay is behind a router, forward the UDP port to the relay machine. You do not need to forward a port to the game host.
Create a room on the remote relay and repeat the test with the new code. If only the local test succeeds, check the address, UDP port, and firewall settings in Troubleshoot connections.