Documentation
¶
Overview ¶
Package transport provides the byte-stream bindings AWP runs over (SPEC.md section 4): tailcat, embedded as a library, plus plain TCP and Unix sockets for Fly 6PN, local use and tests.
Index ¶
Constants ¶
const ( KindTailcat = "tailcat" KindTCP = "tcp" KindUnix = "unix" )
Kinds of address.
const TailcatPort = 1
TailcatPort is the port awp listens on inside the tailcat tunnel. It is the port tailcat's own pipe mode uses, so `tailcat <addr>` connects a terminal straight to an awp peer: you can type NDJSON at it.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Addr ¶
Addr is a parsed awp address.
type TailcatListener ¶
TailcatListener is an awp listener inside a tailcat tunnel.
func ListenTailcat ¶
ListenTailcat starts a tailcat server whose key, pre-shared key and DERP region persist in keyFile, so the address stays the same across restarts (a sandbox waking from sleep comes back at the address its peers know). The first run picks the nearest region and writes the file.
func (*TailcatListener) Address ¶
func (l *TailcatListener) Address() string
Address returns the listener's shareable tailcat address.
func (*TailcatListener) Close ¶
func (l *TailcatListener) Close() error
Close stops the listener and the tailcat server.
type Transport ¶
type Transport struct {
// Logf receives tailcat's diagnostics. Nil discards them.
Logf logger.Logf
// AllowPublicTCP permits plain TCP to public addresses. By default
// awp refuses, as section 4.2 asks: plain TCP has no encryption, so
// it is only for loopback and private networks such as Fly's 6PN.
AllowPublicTCP bool
// contains filtered or unexported fields
}
Transport dials awp addresses. It keeps one tailcat client per tailcat address, since each client is a whole userspace WireGuard node.