BeamMP / BeamMP-Server

Server for the multiplayer mod BeamMP for BeamNG.drive
https://beammp.com
GNU Affero General Public License v3.0
116 stars 49 forks source link

Built in port tester #278

Open snepsnepsnep opened 4 months ago

snepsnepsnep commented 4 months ago

Is your feature request related to a problem? Please describe. A service that would check if the server is accessible from the outside on startup, ideally for both TCP&UDP and print the result in the console. It would save a lot of time with troubleshooting port forwarding and users wouldn't have to use a third party port checking tool.

Describe the solution you'd like A backend api that would be called by the server on startup. It would have to do more than a simple TCP connection to check for UDP connectivity, (ie attempt to send something and check for response).

Describe alternatives you've considered Not doing that and having users continue to use third party tools.

Additional context I am aware that the UDP part is not possible in the current release, but just something to think about for future releases.

Additionally if possible having a built in detection for NAT loopback support, if it's not supported users won't be able to join their server from the server list even if they've forwarded everything correctly, which obviously leads to frustration and less than optimal experience. (example behaviour: if the open port test passes, attempt connection to itself via public IP and see if it works, if not print out a message telling the user to use local IP address when connecting from the game).

lionkor commented 4 months ago

I've started building a service for this, we could extend that and embed it into the backend

Starystars67 commented 4 months ago

I've started building a service for this, we could extend that and embed it into the backend

Yes, we can do that :)

jimkoen commented 4 months ago

The RFC's surrounding UPnP give an option to explicitly check for port availability and NAT status with a firewall. So this could be implemented as part of #273, at least for servers behind domestic firewalls, where the home router is both NAT and WAN gateway.