Skip to content

Can't connect using relay with self hosted Noray server #73

Description

@Mouthless-Stoat

I am trying to host my own noray server. The game can connect to the server just fine and I have all the port recommended on the readme open on my firewall and on my router (8809, 8890, 8891, 49152-51200). But when I try to actually connetc 2 game client to each other they can't seem to establish handshake both using NAT and relay. If i turn on debug logging on my server console, I can see that the client attempt to connect using relay and that the server created a relay for them even replying with the relay, but the client can't establish a handshake for whatever reason.

Sever log:

[11:50:29.012] INFO (noray/5511): Started noray in 219.05981699999998 ms
[11:50:37.663] INFO (cmd:register-host/6jDEiAhXKOCal9OtD8DvkuPr4IvJ_REcf6VzqCnUmTjCr_YgYYNBjQ-n0n5J8x13aIR_x8nQsmGjTA2PKwfxfgwPlfVJ5NrKUCAEIfo2sJcIkfODtnQ8tU7pJiOTweiJ): Registered host from address <MY-IP>:55472
    oid: "aE5SZfMRrVPSo9elcgg7v"
[11:50:37.671] INFO (cmd:register-host/F2gtLv2-Fg9XcxyG6zdMgY_nEQnvSY3CwdvfSGSYxfU7VbvK8n02-F1CyNj9Fg-3VGqFUNdFYUxQl4AY6HVsFcqrMzJJb6xuNeTRFwvPrQ_YVNRmuFEDOpfSHxaPRj_S): Registered host from address <MY-IP>:55484
    oid: "P_6xE7MoAVBXYPck_-MzY"
[11:50:37.684] DEBUG (UDPRemoteRegistrar/6jDEiAhXKOCal9OtD8DvkuPr4IvJ_REcf6VzqCnUmTjCr_YgYYNBjQ-n0n5J8x13aIR_x8nQsmGjTA2PKwfxfgwPlfVJ5NrKUCAEIfo2sJcIkfODtnQ8tU7pJiOTweiJ): Received UDP relay request
    rinfo: {
      "address": "<MY-IP>",
      "family": "IPv4",
      "port": 37982,
      "size": 128
    }
[11:50:37.684] DEBUG (UDPRemoteRegistrar/F2gtLv2-Fg9XcxyG6zdMgY_nEQnvSY3CwdvfSGSYxfU7VbvK8n02-F1CyNj9Fg-3VGqFUNdFYUxQl4AY6HVsFcqrMzJJb6xuNeTRFwvPrQ_YVNRmuFEDOpfSHxaPRj_S): Received UDP relay request
    rinfo: {
      "address": "<MY-IP>",
      "family": "IPv4",
      "port": 39042,
      "size": 128
    }
[11:50:37.766] DEBUG (UDPRemoteRegistrar/6jDEiAhXKOCal9OtD8DvkuPr4IvJ_REcf6VzqCnUmTjCr_YgYYNBjQ-n0n5J8x13aIR_x8nQsmGjTA2PKwfxfgwPlfVJ5NrKUCAEIfo2sJcIkfODtnQ8tU7pJiOTweiJ): Received UDP relay request
    rinfo: {
      "address": "<MY-IP>",
      "family": "IPv4",
      "port": 37982,
      "size": 128
    }
[11:50:37.783] DEBUG (UDPRemoteRegistrar/F2gtLv2-Fg9XcxyG6zdMgY_nEQnvSY3CwdvfSGSYxfU7VbvK8n02-F1CyNj9Fg-3VGqFUNdFYUxQl4AY6HVsFcqrMzJJb6xuNeTRFwvPrQ_YVNRmuFEDOpfSHxaPRj_S): Received UDP relay request
    rinfo: {
      "address": "<MY-IP>",
      "family": "IPv4",
      "port": 39042,
      "size": 128
    }
^[[11:50:56.150] DEBUG (cmd:connect-relay/5511): Client attempting to connect to host
    oid: "P_6xE7MoAVBXYPck_-MzY"
    client: "<MY-IP>:55472"
[11:50:56.150] DEBUG (cmd:connect-relay/5511): Ensuring relay for both parties
[11:50:56.151] DEBUG (UDPRelayHandler/5511): Creating relay
    relay: {
      "address": {
        "address": "<MY-IP>",
        "port": 39042
      },
      "lastSent": 0,
      "lastReceived": 0,
      "created": 1779547856.1510122
    }
[11:50:56.151] DEBUG (UDPRelayHandler/5511): Creating relay
    relay: {
      "address": {
        "address": "<MY-IP>",
        "port": 37982
      },
      "lastSent": 0,
      "lastReceived": 0,
      "created": 1779547856.151569
    }
[11:50:56.151] DEBUG (cmd:connect-relay/5511): Replying with relay
    host: 51200
    client: 51199
[11:50:56.152] DEBUG (cmd:connect-relay/5511): Connected client to host
    client: "<MY-IP>:55472"
    relay: 51200
    oid: "P_6xE7MoAVBXYPck_-MzY"

Router Port Forwarding:

Image

Output from sudo iptables -S

-A nixos-fw -p tcp -m tcp --dport 8890 -j nixos-fw-accept
-A nixos-fw -p tcp -m tcp --dport 8891 -j nixos-fw-accept
-A nixos-fw -p udp -m udp --dport 8809 -j nixos-fw-accept
-A nixos-fw -p udp -m udp --dport 8890 -j nixos-fw-accept
-A nixos-fw -p udp -m udp --dport 8891 -j nixos-fw-accept
-A nixos-fw -p udp -m udp --dport 49152:51200 -j nixos-fw-accept

The .env. is just the .env.example (without the .example ofc)

The Noray server is latest from this repo and the Godot addon version is 1.35.3. The code for the noray connection and network handling work with the test address tomfol.io and port 8890 but not with my self-hosted server.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions