Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/marler8997/netpunch


https://github.com/marler8997/netpunch

Last synced: 2 months ago
JSON representation

Awesome Lists containing this project

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| | |