Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/antonc9018/udp-and-tcp-holepunching-experiments
https://github.com/antonc9018/udp-and-tcp-holepunching-experiments
Last synced: 5 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/antonc9018/udp-and-tcp-holepunching-experiments
- Owner: AntonC9018
- License: mit
- Created: 2020-12-30T16:53:05.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-01-02T18:09:04.000Z (about 4 years ago)
- Last Synced: 2024-11-17T12:45:45.671Z (2 months ago)
- Language: C#
- Size: 111 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TCP and UDP hole punching experiments
This is the code I wrote (or copied and modified) during the research I did for implementing multiplayer in my game.
## Sources I used
### Protobuffs
Useful for defining custom message formats (with automatic serialization into binary and json).
https://developers.google.com/protocol-buffers/docs/tutorials### Hole Punching
A must read paper that actually made sense. Includes info on NAT routers, describes UDP and TCP hole punching AT LENGTH:
https://bford.info/pub/net/p2pnat/Python code people wrote based on that paper. It's not ideal, but serves as reference.
https://github.com/dwoz/python-nat-hole-punching### UDP
UDP hole punching explanation:
https://stackoverflow.com/a/11377330/9731532UDP hole punching implementation:
https://stackoverflow.com/a/53215243/9731532I also cleaned up that code a little bit, see `UDP_StackOverflow`.
My simplified implementation, see `UDP_My_Test`.
### TCP
Mostly used the aforementioned paper and the python code as reference.
How To TCP NAT Traversal. A simple technique with a not self hosted relay server is presented. Note that hosting a relay server is not a problem in my case.
https://gist.github.com/mildred/b803e48801f9cdd8a4a8TCP hole punching wiki:
https://www.wikiwand.com/en/TCP_hole_punching