Author Topic: another interesting host fix wit out port forwarding?  (Read 2887 times)

Offline Warbux

  • Server Admin
  • Axe Thrower
  • *****
  • Posts: 332
    • View Profile
another interesting host fix wit out port forwarding?
« on: July 19, 2019, 05:46:39 AM »
https://forums.pvpgn.pro/viewtopic.php?id=1957

and i quote from the link...

USA-Archer wrote:

    I came up with an idea which I have proved that it works to fix the problem of port forwarding being required in order to host games.

    I actually thought of it one day while I was hacking an IP camera, watching its network traffic, and I wondered how is the server able to send data to this camera through my firewall even though I did not open a port for it? I found out it was possible by doing something called UDP hole punching

    In the context of our game, it works like this:

    1. PlayerA hosts a game, but his port is not forwarded
    2. PlayerA's game client script (a custom Python script add-on) downloads a list of all other player IP addresses from PvPGN (requires server side code for this)
    3. PlayerA's Python script periodically sends UDP traffic to all other players on port 6112
    4. PlayerA's router has now opened port 6112 to each player in order to allow a response from them
    5. Anyone can now join his game

    Here is proof that I got it working, notice the server says my port is closed, but yet abcde is able to join my game:


    Here is the proof of concept code which we are working on implementing for :

    [

    If you are interested in this let me know and we can work together to get this on more servers smile

    Added: 17.05.2018 12:58

    Related forum post (I am AHB there)

    []

Offline iL

  • Administrator
  • Ogre Mage
  • *****
  • Posts: 1653
    • View Profile
Re: another interesting host fix wit out port forwarding?
« Reply #1 on: July 19, 2019, 09:31:07 AM »
That is exaclty the same principal that have been implemented by fois. Except... Archer's script haven't been working.
Also, fois payed attention to lots details to let it works much better, but concept is the same.
Need help to translate War2Combat to German, French, Italian, Polish or another language: http://forum.war2.ru/index.php/topic,4728.0.html
Please, contact me if you are interested in that.

Offline fois

  • Grunt
  • ***
  • Posts: 248
  • Chicken
    • View Profile
Re: another interesting host fix wit out port forwarding?
« Reply #2 on: July 19, 2019, 09:51:15 AM »
His idea does indeed work, but it has a big flaw though... He doesn't know who wants to join your game, that means he has to send data to every single user on the server. His solution would work fine if there are only 20 users online, but if there are 50 then it would start to fail for some players already (ports would start to change, connection limits etc..). With 100 or 200 users (or even more) it wouldn't work anymore.

But yeah the concept is the same, you have to send something to punch a hole and then you're gonna be able to receive (aka the players can join). My solution will only send data to 1 user and not to all, that's why it supports endless amount of players (even 1000 and more are no problem).