Expand description
A minimal SAMv3 client for a router the user already runs. It speaks five commands and nothing else: transient STREAM sessions that never publish a LeaseSet or build a zero-hop tunnel, outbound stream connects, name lookups and a liveness probe. No line it sends can make the router accept a connection or carry someone else’s traffic.
Structs§
- Control
Socket - A session’s control socket. Dropping it ends the session: the router tears a session down within half a second of its control socket closing.
- Router
Test - What the router test in Settings reports: a HELLO, no session.
- SamAuth
- SamVersion
Enums§
- Control
Event - What the router said on a session’s control socket.
- Hello
Error - Liveness
- Stream
Fail
Constants§
- SAM_
HOST - SAM is cleartext, so it never leaves the loopback interface.
Functions§
- b32_of
xxxx.b32.i2pfor a destination in I2P’s base64 (-and~stand for+and/).- connect
- Open a stream from session
nicktodest(a.b32.i2paddress or a base64 destination) onto_port. The returned socket IS the stream. - create_
session - Create a transient STREAM session named
nickon its own control socket. - hello
- Open a SAM socket and agree on 3.2 or newer.
- hello_
text - A short reason for a failed HELLO, for logs and session errors.
- liveness
- Is session
nickalive? A connect to a destination that can’t exist answers at once, without any network traffic:INVALID_KEYfor a live session,INVALID_IDfor a gone one. - lookup
- Resolve a name (or a b32 a router wants as base64) through the router’s address book.
- new_
nick - A fresh session nickname: 128 random bits, nothing that names the app or the account.
- test_
router