hole-punching | TCP and UDP hole punching examples | TCP library
kandi X-RAY | hole-punching Summary
kandi X-RAY | hole-punching Summary
TCP and UDP hole punching examples
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Gets the IP address and port
- Tries to connect to a given host and port
- Get NAT type
- Resolve hostname to IP address
- Get NAT type and port
- Return the IP address and the IP address
- Generate a random TRAN ID
- Read peer connection info from queue
- Parse connection info
hole-punching Key Features
hole-punching Examples and Code Snippets
Community Discussions
Trending Discussions on hole-punching
QUESTION
I have a somewhat unique situation where I require the ability to perform NAT hole punching for a multi node peer to peer type application; where all nodes must reference each other from publicly accessible IP addresses, even when some of those nodes might reside on the local subnet.
I have been able to successfully map ports with help from this question (UDP hole punching implementation) using Open.Nat.
My code is basically as simple as this:
...ANSWER
Answered 2020-Feb-10 at 05:28This isn't really something you can fix, and it isn't really specific to C#. Most routers will only match NAT packets that arrive on their internet facing interface. If you want to allow for multiple nodes running behind the same NAT to connect directly to each other, you will need to implement another solution.
For example, you could share each node's private interface addresses. Then attempt to connect directly if the public address matches.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install hole-punching
You can use hole-punching like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page