ProxyPass icon indicating copy to clipboard operation
ProxyPass copied to clipboard

Don't use PONG ports

Open bundabrg opened this issue 4 years ago • 5 comments

This fixes a bedrock server being port forwarded with a different port than configured. For example BDS:19130 and a router with port 19133 forwarding.

If trying to connect using a bedrock client in this config, proxypass will make a single ping to the downstream server, then update its port to that returned in the pong packet (if not -1) and then continue trying to connect.

We simply skip this step and honour the port specified in the config file.

bundabrg avatar Jul 30 '20 06:07 bundabrg

I now understand why ProxyPass defaults to this. A device will advertise a different port to represent a "LAN" connection versus an invited connection.

However by enforcing a port lookup we can't ever proxypass to a bedrock device that has port forwards. Perhaps this needs to be an option to differentiate between the two options OR a connection is attempted using both ports in turn till one works.

bundabrg avatar Jul 30 '20 07:07 bundabrg

This is vanilla behaviour so I think it should be kept. The random port range that vanilla servers generate is the bug here because you don't have any control over what value is set so you can never have the correct ports forwarded. Checkout BDS-1094 for more information.

SupremeMortal avatar Jul 30 '20 08:07 SupremeMortal

The issue is:

  1. With the existing behaviour its impossible to connect to a Bedrock server behind a port forward using proxypass. It will be required for #13 for example.

  2. With the changed behaviour here, you end up connecting to the correct port but it will not allow it due to ProxyPass not being invited properly.

The random ports are LAN ports (offline) and the set ports are Online ports as far as I can gather.

bundabrg avatar Jul 30 '20 09:07 bundabrg

The random ports are the ones in which the Minecraft connection takes place. They need to be port forwarded in order for you to be able to to connect to the server.

SupremeMortal avatar Jul 30 '20 11:07 SupremeMortal

This does not seem to be the case. If I run 'bedrock_server' under linux with the following line in server.properties:

server-port=19131

and port forward ONLY port 19133 from outside to port 19131 it works perfectly fine. I can connect without issue.

EDIT: Perhaps the dedicated server and the games themselves have different logic to how they work. I've been talking about the dedicated server here whereas the game operates how you describe with a facade port simply there to redirect to the proper port.

bundabrg avatar Jul 30 '20 11:07 bundabrg