pvpgn / pvpgn-server

Next generation of PvPGN server
https://pvpgn.pro
GNU General Public License v2.0
556 stars 155 forks source link

Make posible host without port forwarding #396

Closed vioviorel closed 4 years ago

vioviorel commented 4 years ago

Hello i want to help implement hosting games without port forwarding or UDP punching. We can make reverse tunneling we just need to modify lobby instead show user ip to show ip of tunnel and port assigned for tunnel for that user.

The rest its scripting for client. ( client will have app who will do the rest ). i could do that.

cen1 commented 4 years ago

I played around with reverse SSH tunnel and had a working proof of concept a year ago (I just hardcoded some host:port on pvpgn to some public server) and then reverse SSHed to that from client. Sounds to me like you are proposing something similar?

The hurdle I encountered is that currently, pvpgn will take the IP from established connection as the host IP, there is no IP in bnet packet to fake (STARTADVEX3). You can't just lie about your IP unless you use some kind of VPN in the middle. My thinking was to encode the tunneled IP in packet flags or invent a new BNET packet which pvpgn and gproxy would understand, then lie to the w3 client to connect to the tunneled IP.

I think it is doable and I could help a bit on the client side but I would like to see the full technical plan first, not just theory.

Also, one bad thing about this is that it adds a hop and therefore more lag.

vioviorel commented 4 years ago

Its already working. Because i was not able to modify pvpgn reason its i dont know to much c. i do something like this. i make reverse tunnel for 3 ports. 1 its for proxy sock. and 2 its for tcp. 1 transport udp trough tcp and 1 transport tcp. when player enter battle.net he show ip of tunnel. That tunnel its only for port 6112 not for all his ports. so player will enter on pvpgn with server tunnel ip. And its working very fine i can host games without any problem.

vioviorel commented 4 years ago

another solution its similar but when player connect to change his ip in lobby.

cen1 commented 4 years ago

In that case feel free to open a pull request against develop branch and give instructions on how to test it.