Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/tailscale/tailcat
/ functions
Functions
179 in github.com/tailscale/tailcat
⨍
Functions
179
◇
Types & classes
21
↓ 28 callers
Method
Close
Close shuts down the server, closing the WireGuard engine and DERP connections.
tailcat.go:538
↓ 26 callers
Method
Get
Get returns the previously stored DERP map response for url: its raw JSON, the server's ETag (or ""), and when it was stored. It returns ok == false i
tailcat.go:113
↓ 15 callers
Method
Start
Start connects to the DERP relay and begins accepting clients, first picking defaults for any unset configuration fields: a new ephemeral key, log.Pri
tailcat.go:356
↓ 10 callers
Method
ConnBlob
ConnBlob returns the token that clients use to connect to this server. It embeds the full DERP region, so clients don't need to fetch the DERP map fro
tailcat.go:611
↓ 9 callers
Method
DialTCPPort
DialTCPPort opens a TCP connection to the given port on the server. See [Client.Dial] for the lazy startup behavior.
tailcat.go:1753
↓ 9 callers
Method
Ping
Ping starts the client if needed (see [Client.Dial] for the lazy startup behavior), sends a meow ping to the server via DERP, and waits for the meowed
tailcat.go:1646
↓ 8 callers
Method
Addr
Addr returns the server's IPv6 address derived from its public key. It must only be called after [Server.Start].
tailcat.go:535
↓ 8 callers
Method
Close
Close shuts down the client, closing the WireGuard engine and DERP connections.
tailcat.go:1572
↓ 6 callers
Method
CloseWrite
()
tailcat.go:1791
↓ 6 callers
Function
tcAddrForKey
(k key.NodePublic)
tailcat.go:1331
↓ 6 callers
Function
usage
(err string)
cmd/tailcat/tailcat.go:61
↓ 5 callers
Function
$
(id)
web/app.js:55
↓ 5 callers
Method
Expand
Expand populates ci.Region from a DERP map if only ci.RegionID was set. If ci.Region is already populated, Expand is a no-op. When RegionID is -1, the
tailcat.go:933
↓ 5 callers
Function
ParseConnBlob
ParseConnBlob decodes a [ConnBlob] back into a [ConnInfo], restoring fields that were stripped during encoding (RegionID, RegionCode, node names).
tailcat.go:747
↓ 5 callers
Method
derpRegionID
()
tailcat.go:238
↓ 4 callers
Function
Handler
Handler returns an HTTP handler serving the web app from dist, a filesystem containing the files built by wasmbuild.Dist: index.html at "/", app.js, w
webdemo/webdemo.go:29
↓ 4 callers
Function
PingForTest
PingForTest waits for the client's DERP connection and performs the meow/meowed handshake.
export_test.go:36
↓ 4 callers
Function
addrBlobArg
addrBlobArg interprets a CLI destination argument as either a "tc"-prefixed address blob or a DNS name whose "tailcat=" TXT record holds one. A dot ca
cmd/tailcat/tailcat.go:255
↓ 4 callers
Function
checkPageErrors
(t *testing.T, runCtx context.Context)
web/wasm_test.go:208
↓ 4 callers
Function
clientKey
()
cmd/tailcat/tailcat.go:277
↓ 4 callers
Function
launchChrome
launchChrome boots a headless Chrome under chromedp and returns a context whose cancellation tears down the browser.
web/wasm_test.go:169
↓ 4 callers
Function
mkLogf
bytes sent in each direction's test
web/wasm_test.go:47
↓ 4 callers
Function
newWebServer
newWebServer serves the web app's freshly built dist directory via webdemo.Handler (the same handler production servers use), plus a same-origin /derp
web/wasm_test.go:146
↓ 4 callers
Function
preflight
preflight skips the test unless --run-headless-browser-tests is set, and returns the path to a Chromium-family binary, failing the test if none is fou
web/wasm_test.go:60
↓ 4 callers
Method
up
up ensures the client is started and the server has acknowledged us as a peer, performing the meow handshake on first use. Dial methods call it so tha
tailcat.go:1631
↓ 3 callers
Method
DialTCP
DialTCP opens a TCP connection to an arbitrary IP:port through the server, which must be configured as an exit node (see [Server.OnTCPForward]). IPv4
tailcat.go:1770
↓ 3 callers
Function
Dist
Dist builds the complete set of static files a server needs to serve the web app: main.wasm (compiled from the Go package in webDir, with precompresse
internal/wasmbuild/wasmbuild.go:92
↓ 3 callers
Method
advertiseEndpoints
advertiseEndpoints sends our current UDP endpoints to every known peer in a disco CallMeMaybe message over DERP, the same message the control plane fl
tailcat.go:1111
↓ 3 callers
Function
keyPath
(name string)
cmd/tailcat/tailcat.go:970
↓ 3 callers
Function
makePromise
makePromise runs f on a new goroutine and returns a JavaScript Promise of its result, rejected with a JavaScript Error if f returns an error.
web/main_js.go:282
↓ 3 callers
Function
mkLogger
(t testing.TB, name string)
tailcat_test.go:28
↓ 3 callers
Function
newClient
newClient returns a [tailcat.Client] configured with the global --derpmap-url flag and the disk DERP map cache.
cmd/tailcat/tailcat.go:303
↓ 3 callers
Function
nodePrivateAsDiscoPrivate
nodePrivateAsDiscoPrivate converts a NodePrivate to a DiscoPrivate by reusing the same raw key bytes. This is used in tailcat where the server uses it
tailcat.go:1830
↓ 3 callers
Function
rejectedPromise
(err error)
web/main_js.go:297
↓ 3 callers
Function
setStatus
(msg)
web/app.js:56
↓ 2 callers
Method
AddAllowedClient
AddAllowedClient adds k as an allowed client. Until a key is allowed (here or via [Server.AllowedClients]), all clients are allowed.
tailcat.go:596
↓ 2 callers
Method
ConnBlob
ConnBlob serializes the ConnInfo into a compact [ConnBlob] string. It is encoded via the wire types (see wire.go), which drop the DERP region fields t
tailcat.go:658
↓ 2 callers
Method
Dial
Dial opens a connection to the given network/address through the server's WireGuard tunnel. The address is resolved relative to the server. On a Clie
tailcat.go:1744
↓ 2 callers
Function
FetchDERPMap
FetchDERPMap fetches and decodes the JSON DERP map. The opts may contain any of the following types: - [DERPMapURL]: fetch from an alternate URL inste
tailcat.go:789
↓ 2 callers
Function
IsMeowPacket
IsMeowPacket reports whether pkt starts with the meow magic prefix.
disco.go:26
↓ 2 callers
Function
IsMeowedPacket
IsMeowedPacket reports whether pkt is a meowed (acknowledgment) packet.
disco.go:65
↓ 2 callers
Function
NewPrivateKey
NewPrivateKey returns a new PrivateKey, but without the DERP region populated. It's up to the caller to populate that.
tailcat.go:197
↓ 2 callers
Function
PickBestRegion
PickBestRegion runs a netcheck over the DERP regions in dm and returns the region ID with the lowest latency. It returns 0 (and a nil error) if the ne
pickregion.go:24
↓ 2 callers
Function
ProxyConns
ProxyConns copies data between a and b in both directions until both sides have finished, then closes both connections. When one direction's copy fin
tailcat.go:1803
↓ 2 callers
Method
Status
Status returns the current WireGuard and DERP connection status.
tailcat.go:1823
↓ 2 callers
Function
WaitForDERPForTest
WaitForDERPForTest waits for the server's and client's DERP connections. Integration tests should use this instead of guessing how long startup takes.
export_test.go:14
↓ 2 callers
Function
classifySOCKSAddr
classifySOCKSAddr decides where the SOCKS5 destination addr should be dialed. The magic hostname "server.tailcat" (or an empty host) means the tailcat
cmd/tailcat/tailcat.go:608
↓ 2 callers
Function
createEngine
createEngine creates the wgengine.Engine with userspace networking.
tailcat.go:1358
↓ 2 callers
Method
derpRegion
derpRegion converts w back to a [tailcfg.DERPRegion].
wire.go:91
↓ 2 callers
Method
ensureStarted
ensureStarted brings up the client's network stack on first use: it resolves the server's DERP region if the ConnBlob didn't embed it (possibly fetchi
tailcat.go:1594
↓ 2 callers
Function
exitCode
exitCode extracts the exit code from an exec error.
tailcat_ssh.go:270
↓ 2 callers
Function
fakeDist
()
webdemo/webdemo_test.go:15
↓ 2 callers
Function
fetchDERPMap
fetchDERPMap fetches and decodes the JSON DERP map from fetchURL, sending mode ("client" or "server") as the Tailcat-Mode hint header. If cache is nil
tailcat.go:847
↓ 2 callers
Function
keyIsPath
(name string)
cmd/tailcat/tailcat.go:966
↓ 2 callers
Function
makeJSConn
makeJSConn wraps a tunneled TCP connection as a JavaScript object: { port: number, read: () => Promise<Uint8Array|null>, // null on EOF; no co
web/main_js.go:212
↓ 2 callers
Function
newLocoBackend
(priv key.NodePrivate)
tailcat.go:615
↓ 2 callers
Function
newNetstack
(logf logger.Logf, sys *tsd.System)
tailcat.go:1346
↓ 2 callers
Method
nodeKeyLocked
nodeKeyLocked returns the client's effective node private key, resolving it from the Key field (or generating a fresh one) on first use. c.startMu mus
tailcat.go:1440
↓ 2 callers
Function
normalizeListenAddrPort
normalizeListenAddrPort fills in the missing parts of the --listen flag value s so it's a valid net.Listen address. A bare port means localhost on tha
cmd/tailcat/tailcat.go:470
↓ 2 callers
Function
optLogf
(v js.Value)
web/main_js.go:272
↓ 2 callers
Function
optString
(v js.Value, name string)
web/main_js.go:265
↓ 2 callers
Function
parseWire
parseWire decodes cb into its wire form, without restoring the fields that [ConnInfo.ConnBlob] elides.
tailcat.go:719
↓ 2 callers
Method
paths
(url string)
cmd/tailcat/tailcat.go:319
↓ 2 callers
Method
peerByIP
peerByIP returns the public key of the peer that outbound packets addressed to dst should be sent to (see [wgengine.Engine.SetPeerByIPPacketFunc]).
tailcat.go:1041
↓ 2 callers
Function
pfxOf
(a netip.Addr)
tailcat.go:1783
↓ 2 callers
Function
sha256Hex
(bytes)
web/app.js:62
↓ 2 callers
Function
sshDestHost
sshDestHost returns the hostname to give the system ssh client as the connection destination for a tailcat ConnBlob. It is a short, deterministic func
cmd/tailcat/ssh.go:104
↓ 2 callers
Function
sshProxyCommand
sshProxyCommand returns the command passed to OpenSSH to connect the SSH client to a tailcat server. The command is run by OpenSSH, so values that can
cmd/tailcat/ssh.go:78
↓ 2 callers
Function
wireRegionOf
wireRegionOf converts a [tailcfg.DERPRegion] (such as one from the control plane's DERP map) to its wire form. Fields tailcat doesn't use (Latitude, L
wire.go:65
↓ 1 callers
Function
Build
Build compiles the Go package in pkgDir for js/wasm and writes the binary to outPath.
internal/wasmbuild/wasmbuild.go:77
↓ 1 callers
Method
DiscoPing
DiscoPing sends a disco ping to the server and reports how the pong came back: the result's Endpoint field is set if it arrived over a direct path, el
tailcat.go:1696
↓ 1 callers
Method
DrainTCP
DrainTCP waits until every TCP connection in the server's netstack has fully closed, meaning the peer has acknowledged all sent data and the final FIN
tailcat.go:560
↓ 1 callers
Function
EncodeMeowPing
EncodeMeowPing encodes a meow ping packet containing the sender's node public key and disco public key.
disco.go:32
↓ 1 callers
Function
EncodeMeowed
EncodeMeowed encodes a meowed (acknowledgment) packet.
disco.go:42
↓ 1 callers
Method
Equal
Equal reports whether a and b represent the same public key.
tailcat.go:182
↓ 1 callers
Function
GoRoot
GoRoot returns the GOROOT of the go command in $PATH.
internal/wasmbuild/wasmbuild.go:25
↓ 1 callers
Function
ParseConnBlobRaw
ParseConnBlobRaw decodes cb into its wire form, without restoring the implicit fields that [ParseConnBlob] synthesizes (region and node IDs, region co
tailcat.go:740
↓ 1 callers
Function
ParseMeowPing
ParseMeowPing parses a meow ping packet, returning the sender's node public key and disco public key. The pkt must have already been verified with IsM
disco.go:52
↓ 1 callers
Method
PublicKey
PublicKey returns the client's node public key, generating the key first if the Key field is zero and the client hasn't yet been used.
tailcat.go:1565
↓ 1 callers
Method
Put
Put stores the DERP map response for url, replacing any prior entry and marking it stored as of now. An empty etag means the server sent none.
tailcat.go:118
↓ 1 callers
Method
Resolve
Resolve returns a self-contained equivalent of b with the DERP relay's details embedded, so that later use of the blob requires no network access to f
tailcat.go:698
↓ 1 callers
Function
SupportsSSHServer
SupportsSSHServer reports whether the platform supports running the built-in auth-free SSH server.
tailcat_ssh_stub.go:14
↓ 1 callers
Function
Tags
Tags returns the comma-joined -tags value for the wasm build, sorted so the same source tree always produces the same wasm bytes.
internal/wasmbuild/wasmbuild.go:55
↓ 1 callers
Function
WasmExecJS
WasmExecJS returns the path to the Go toolchain's wasm_exec.js, the JavaScript support file needed to run Go wasm binaries.
internal/wasmbuild/wasmbuild.go:35
↓ 1 callers
Function
acceptEnvPair
acceptEnvPair reports whether the environment variable key=value pair should be accepted from the client (same default as OpenSSH AcceptEnv).
tailcat_ssh.go:280
↓ 1 callers
Method
buildFilter
buildFilter returns the packet filter enforcing what the server is configured to serve: new inbound TCP connections are admitted only to the server's
tailcat.go:502
↓ 1 callers
Function
chose
()
web/app.js:170
↓ 1 callers
Function
clearUnnecessaryRegionFields
(r *tailcfg.DERPRegion)
cmd/tailcat/tailcat.go:1186
↓ 1 callers
Function
clientMode
(logf logger.Logf, connStr, optDest string)
cmd/tailcat/tailcat.go:407
↓ 1 callers
Function
clientParseMode
(logf logger.Logf)
cmd/tailcat/tailcat.go:646
↓ 1 callers
Function
clientPingMode
(logf logger.Logf)
cmd/tailcat/tailcat.go:367
↓ 1 callers
Function
clientResolveMode
()
cmd/tailcat/tailcat.go:660
↓ 1 callers
Function
clientSOCKSMode
(logf logger.Logf)
cmd/tailcat/tailcat.go:483
↓ 1 callers
Function
clientSSHMode
(logf logger.Logf)
cmd/tailcat/ssh.go:26
↓ 1 callers
Function
compressWasm
compressWasm writes path.zst and path.gz next to path.
internal/wasmbuild/wasmbuild.go:131
↓ 1 callers
Method
connBlob
()
tailcat.go:634
↓ 1 callers
Function
copyFile
(src, dst string)
internal/wasmbuild/wasmbuild.go:122
↓ 1 callers
Function
countProgress
(stream, total, wireBytes)
web/app.js:69
↓ 1 callers
Function
decodeDERPMap
decodeDERPMap decodes a JSON DERP map, returning nil if data is empty or invalid.
tailcat.go:909
↓ 1 callers
Function
defaultPath
defaultPath returns the default PATH for the given user.
tailcat_ssh.go:306
next →
1–100 of 179, ranked by callers