MCPcopy Create free account

hub / github.com/tailscale/tailcat / functions

Functions179 in github.com/tailscale/tailcat

↓ 28 callersMethodClose
Close shuts down the server, closing the WireGuard engine and DERP connections.
tailcat.go:538
↓ 26 callersMethodGet
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 callersMethodStart
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 callersMethodConnBlob
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 callersMethodDialTCPPort
DialTCPPort opens a TCP connection to the given port on the server. See [Client.Dial] for the lazy startup behavior.
tailcat.go:1753
↓ 9 callersMethodPing
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 callersMethodAddr
Addr returns the server's IPv6 address derived from its public key. It must only be called after [Server.Start].
tailcat.go:535
↓ 8 callersMethodClose
Close shuts down the client, closing the WireGuard engine and DERP connections.
tailcat.go:1572
↓ 6 callersMethodCloseWrite
()
tailcat.go:1791
↓ 6 callersFunctiontcAddrForKey
(k key.NodePublic)
tailcat.go:1331
↓ 6 callersFunctionusage
(err string)
cmd/tailcat/tailcat.go:61
↓ 5 callersFunction$
(id)
web/app.js:55
↓ 5 callersMethodExpand
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 callersFunctionParseConnBlob
ParseConnBlob decodes a [ConnBlob] back into a [ConnInfo], restoring fields that were stripped during encoding (RegionID, RegionCode, node names).
tailcat.go:747
↓ 5 callersMethodderpRegionID
()
tailcat.go:238
↓ 4 callersFunctionHandler
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 callersFunctionPingForTest
PingForTest waits for the client's DERP connection and performs the meow/meowed handshake.
export_test.go:36
↓ 4 callersFunctionaddrBlobArg
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 callersFunctioncheckPageErrors
(t *testing.T, runCtx context.Context)
web/wasm_test.go:208
↓ 4 callersFunctionclientKey
()
cmd/tailcat/tailcat.go:277
↓ 4 callersFunctionlaunchChrome
launchChrome boots a headless Chrome under chromedp and returns a context whose cancellation tears down the browser.
web/wasm_test.go:169
↓ 4 callersFunctionmkLogf
bytes sent in each direction's test
web/wasm_test.go:47
↓ 4 callersFunctionnewWebServer
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 callersFunctionpreflight
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 callersMethodup
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 callersMethodDialTCP
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 callersFunctionDist
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 callersMethodadvertiseEndpoints
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 callersFunctionkeyPath
(name string)
cmd/tailcat/tailcat.go:970
↓ 3 callersFunctionmakePromise
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 callersFunctionmkLogger
(t testing.TB, name string)
tailcat_test.go:28
↓ 3 callersFunctionnewClient
newClient returns a [tailcat.Client] configured with the global --derpmap-url flag and the disk DERP map cache.
cmd/tailcat/tailcat.go:303
↓ 3 callersFunctionnodePrivateAsDiscoPrivate
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 callersFunctionrejectedPromise
(err error)
web/main_js.go:297
↓ 3 callersFunctionsetStatus
(msg)
web/app.js:56
↓ 2 callersMethodAddAllowedClient
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 callersMethodConnBlob
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 callersMethodDial
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 callersFunctionFetchDERPMap
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 callersFunctionIsMeowPacket
IsMeowPacket reports whether pkt starts with the meow magic prefix.
disco.go:26
↓ 2 callersFunctionIsMeowedPacket
IsMeowedPacket reports whether pkt is a meowed (acknowledgment) packet.
disco.go:65
↓ 2 callersFunctionNewPrivateKey
NewPrivateKey returns a new PrivateKey, but without the DERP region populated. It's up to the caller to populate that.
tailcat.go:197
↓ 2 callersFunctionPickBestRegion
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 callersFunctionProxyConns
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 callersMethodStatus
Status returns the current WireGuard and DERP connection status.
tailcat.go:1823
↓ 2 callersFunctionWaitForDERPForTest
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 callersFunctionclassifySOCKSAddr
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 callersFunctioncreateEngine
createEngine creates the wgengine.Engine with userspace networking.
tailcat.go:1358
↓ 2 callersMethodderpRegion
derpRegion converts w back to a [tailcfg.DERPRegion].
wire.go:91
↓ 2 callersMethodensureStarted
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 callersFunctionexitCode
exitCode extracts the exit code from an exec error.
tailcat_ssh.go:270
↓ 2 callersFunctionfakeDist
()
webdemo/webdemo_test.go:15
↓ 2 callersFunctionfetchDERPMap
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 callersFunctionkeyIsPath
(name string)
cmd/tailcat/tailcat.go:966
↓ 2 callersFunctionmakeJSConn
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 callersFunctionnewLocoBackend
(priv key.NodePrivate)
tailcat.go:615
↓ 2 callersFunctionnewNetstack
(logf logger.Logf, sys *tsd.System)
tailcat.go:1346
↓ 2 callersMethodnodeKeyLocked
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 callersFunctionnormalizeListenAddrPort
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 callersFunctionoptLogf
(v js.Value)
web/main_js.go:272
↓ 2 callersFunctionoptString
(v js.Value, name string)
web/main_js.go:265
↓ 2 callersFunctionparseWire
parseWire decodes cb into its wire form, without restoring the fields that [ConnInfo.ConnBlob] elides.
tailcat.go:719
↓ 2 callersMethodpaths
(url string)
cmd/tailcat/tailcat.go:319
↓ 2 callersMethodpeerByIP
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 callersFunctionpfxOf
(a netip.Addr)
tailcat.go:1783
↓ 2 callersFunctionsha256Hex
(bytes)
web/app.js:62
↓ 2 callersFunctionsshDestHost
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 callersFunctionsshProxyCommand
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 callersFunctionwireRegionOf
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 callersFunctionBuild
Build compiles the Go package in pkgDir for js/wasm and writes the binary to outPath.
internal/wasmbuild/wasmbuild.go:77
↓ 1 callersMethodDiscoPing
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 callersMethodDrainTCP
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 callersFunctionEncodeMeowPing
EncodeMeowPing encodes a meow ping packet containing the sender's node public key and disco public key.
disco.go:32
↓ 1 callersFunctionEncodeMeowed
EncodeMeowed encodes a meowed (acknowledgment) packet.
disco.go:42
↓ 1 callersMethodEqual
Equal reports whether a and b represent the same public key.
tailcat.go:182
↓ 1 callersFunctionGoRoot
GoRoot returns the GOROOT of the go command in $PATH.
internal/wasmbuild/wasmbuild.go:25
↓ 1 callersFunctionParseConnBlobRaw
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 callersFunctionParseMeowPing
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 callersMethodPublicKey
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 callersMethodPut
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 callersMethodResolve
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 callersFunctionSupportsSSHServer
SupportsSSHServer reports whether the platform supports running the built-in auth-free SSH server.
tailcat_ssh_stub.go:14
↓ 1 callersFunctionTags
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 callersFunctionWasmExecJS
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 callersFunctionacceptEnvPair
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 callersMethodbuildFilter
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 callersFunctionchose
()
web/app.js:170
↓ 1 callersFunctionclearUnnecessaryRegionFields
(r *tailcfg.DERPRegion)
cmd/tailcat/tailcat.go:1186
↓ 1 callersFunctionclientMode
(logf logger.Logf, connStr, optDest string)
cmd/tailcat/tailcat.go:407
↓ 1 callersFunctionclientParseMode
(logf logger.Logf)
cmd/tailcat/tailcat.go:646
↓ 1 callersFunctionclientPingMode
(logf logger.Logf)
cmd/tailcat/tailcat.go:367
↓ 1 callersFunctionclientResolveMode
()
cmd/tailcat/tailcat.go:660
↓ 1 callersFunctionclientSOCKSMode
(logf logger.Logf)
cmd/tailcat/tailcat.go:483
↓ 1 callersFunctionclientSSHMode
(logf logger.Logf)
cmd/tailcat/ssh.go:26
↓ 1 callersFunctioncompressWasm
compressWasm writes path.zst and path.gz next to path.
internal/wasmbuild/wasmbuild.go:131
↓ 1 callersMethodconnBlob
()
tailcat.go:634
↓ 1 callersFunctioncopyFile
(src, dst string)
internal/wasmbuild/wasmbuild.go:122
↓ 1 callersFunctioncountProgress
(stream, total, wireBytes)
web/app.js:69
↓ 1 callersFunctiondecodeDERPMap
decodeDERPMap decodes a JSON DERP map, returning nil if data is empty or invalid.
tailcat.go:909
↓ 1 callersFunctiondefaultPath
defaultPath returns the default PATH for the given user.
tailcat_ssh.go:306
next →1–100 of 179, ranked by callers