War2.ru Slogan
News: There's a new version of War2Observe that fixes the crash issue,
download from the downloads page today!


Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
Welcome to the forums! We're glad to have you here! :) You can register your account here, then feel free to introduce yourself in the Server.War2.ru board & let us know who you are on the server.

another interesting host fix wit out port forwarding? 246  2

Server Admin Axe Thrower Posts: 291 Karma: +12/-0 *****

Warbux

  • Server Admin
  • Axe Thrower
  • *****
  • Posts: 291
    • 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)

    []
Administrator Ogre Posts: 1446 Karma: +141/-9 *****

iL

  • Administrator
  • Ogre
  • *****
  • *
  • Posts: 1446
    • View Profile
*

iL

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.
Grunt Posts: 119 Karma: +17/-0 Chicken ***

fois

  • Grunt
  • ***
  • *
  • Posts: 119
  • 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).