Skip to content

Speak protocol v1 (SPEC.md draft 2) - #1

Open
kylemclaren wants to merge 1 commit into
mainfrom
draft-2
Open

kylemclaren wants to merge 1 commit into
mainfrom
draft-2

Conversation

@kylemclaren

Copy link
Copy Markdown
Contributor

Moves the Go SDK to draft 2 of the protocol. It pins the engine at the head of agentwireprotocol/awp#30 (stacked on #28). Once those merge and a release is tagged, the pin moves to the tag.

Changes

  • Carriers. Options.Listen takes carriers: tailcat, udp:HOST:PORT, ws:HOST:PORT[=URL], cloudflare and unix:/path. AllowPlaintext is gone, since draft 2 has no plaintext mode. Cloudflared names the binary for the cloudflare carrier.
  • Addresses.
    • Address() returns the one awp1 address to share.
    • Endpoints() and Pending() report the carriers.
    • WaitAddress(ctx) waits for tailcat or cloudflare to come up.
    • These replace Addresses() and TailcatAddress().
  • RotatePSK() shuts out strangers holding an old address, but not peers already met.
  • Docs: README carriers table, and the echo example prints its address.

Testing

go test -race ./... passes. New tests:

  • Conformance in listen mode, with the runner listening on UDP.
  • A peer on UDP and WebSocket gets one address with both endpoints.
  • Rotation: a stranger holding the old address is refused, a peer already met reconnects, and the new address works.

Pin the awp engine at the draft 2 commit (agentwireprotocol/awp#30):
every connection is a WireGuard tunnel between the peers' keys, carried
by tailcat, udp, ws, cloudflare or unix.

- Options.Listen takes carriers; AllowPlaintext is gone, Cloudflared
  names the binary for the cloudflare carrier.
- Address, Endpoints, Pending and WaitAddress replace Addresses and
  TailcatAddress; RotatePSK replaces the admission secret.
- Tests: conformance in both modes, one address over udp and ws, and
  rotation shutting out strangers but not peers already met.
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

Successfully merging this pull request may close these issues.

1 participant