Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: Implement some kind (or various) of hole punching #40

Open
Anyeos opened this issue Aug 30, 2022 · 2 comments
Open

Suggestion: Implement some kind (or various) of hole punching #40

Anyeos opened this issue Aug 30, 2022 · 2 comments

Comments

@Anyeos
Copy link

Anyeos commented Aug 30, 2022

I am actually developing a game that need to host game servers in user side and the NAT are a problem. UPnP does not work on all routers (no all CPE routers have a public IP neither), so UDP hole punching will be a solution that can works.

I am implementing my own code for that purpose but will be great to have that already included on the library itself simplyfing the things and adding that support out of the box.

I want to suggest:

  • UDP hole punching functions to initiate a connection to some host using a 3rd party server.
  • STUN/TURN and ICE as a second and better option.

Than you for reading and for the interest of making this project.

@inlife
Copy link
Member

inlife commented Aug 31, 2022

Hey @Anyeos !

Here is a small project showcasing how to achieve hole punching with an intermediate server: https://github.com/codecat/enet-p2p

Not exactly what you've asked, but might help!

@Anyeos
Copy link
Author

Anyeos commented Sep 22, 2022

Yes, and thank you for the link.
But because hole punching is a low level thing, I think that it must be implemented directly on the ENET library.

ENET as is does not simplify hole punching because it cannot handle for example a kind of negotiation on peers, it directly listen or connects to. But if hole punching is implemented between ENET we can simply add the server (STUN or a custom one) as an extra parameter and all the rest remains the same.

Right now I need to implement a hole punching outside ENET (i.e.: using UDP socks directly) and next some kind of hacking to make ENET establish the connection. And it took me more than a week and still does not work.

There are various examples lying around but from that to real is a test and fail approach. If it is implemented directly on ENET it will not need the hacking part and it have more probability to work.

For now I will continue testig and trying to make it work outside of ENET because that is my only option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants