Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marler8997/netpunch
https://github.com/marler8997/netpunch
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/marler8997/netpunch
- Owner: marler8997
- Created: 2020-03-16T16:39:20.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-02-14T13:06:57.000Z (10 months ago)
- Last Synced: 2024-08-02T22:27:32.045Z (4 months ago)
- Language: Zig
- Size: 222 KB
- Stars: 15
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-zig - marler8997/netpunch
README
# TODO
I need to fix timestamp semantics after `std.time.milliTimestamp` was changed to a signed type. I need to fix `zig test timing.zig`.
# Punch Protocol
Connection is initiated with a handshake. 8 bytes for the punch protocol magic value `0x8ec04ff4a00e8694`, then 1-byte indicating which role the endpoint is taking. `0` for the initiator role which will be opening tunnels, and `1` for the forwarder role which will accept OpenTunnel messages and forward the tunnel data to another endpoint.
> TODO: support authentication? Allow an authenticate command which requires a sequence of bytes to be sent from the other endpoint.
### Common Messages
| Message | ID| Length | Data |
|-------------|---|------------------|---------|
| Heartbeat | 0 | | |
| CloseTunnel | 1 | | |
| Data | 2 | Length (8 bytes) | Data... |### InitiatorOnly Messages
| Message | ID| Length | Data |
|-------------|---|------------------|---------|
| OpenTunnel |128| | |