How does velocity work?

I'm interested in using TCPshield with a forge server and AFAIK the only way is by using a proxy such as velocity. I am having some problems but also have some questions about the fundamentals here.

So I am reading all these docs and have some docker containers up for velocity and curseforge, but have a problem where I cannot connect.

I think this is due to the ports being set incorrectly in the server.properties and/or the velocity config. But what should they be? My server properties is 25566, the velocity server is using 25577 (default), with the forge server set to "127.0.0.1:25566".

My question about fundamentals is how do clients even know which port to connect on? I see for velocity that all backend servers should be using different ports eg, 30066, 30067, 30068, and velocity has 25577, so how does a client connect via 25565?
Was this page helpful?