package proxymap
import "tailscale.com/proxymap"
Package proxymap contains a mapping table for ephemeral localhost ports used by tailscaled on behalf of remote Tailscale IPs for proxied connections.
Index ¶
- type Mapper
- func (m *Mapper) RegisterIPPortIdentity(proto string, ipport netip.AddrPort, tsIP netip.Addr) error
- func (m *Mapper) String() string
- func (m *Mapper) UnregisterIPPortIdentity(proto string, ipport netip.AddrPort)
- func (m *Mapper) WhoIsIPPort(proto string, ipport netip.AddrPort) (tsIP netip.Addr, ok bool)
Types ¶
type Mapper ¶
type Mapper struct {
// contains filtered or unexported fields
}
Mapper tracks which localhost ip:ports correspond to which remote Tailscale IPs for connections proxied by tailscaled.
This is then used (via the WhoIsIPPort method) by localhost applications to ask tailscaled (via the LocalAPI WhoIs method) the Tailscale identity that a given localhost:port corresponds to.
func (*Mapper) RegisterIPPortIdentity ¶
RegisterIPPortIdentity registers a given node (identified by its Tailscale IP) as temporarily having the given IP:port for whois lookups.
The IP:port is generally a localhost IP and an ephemeral port, used while proxying connections to localhost when tailscaled is running in netstack mode.
The proto is the network protocol that is being proxied; it must be "tcp" or "udp" (not e.g. "tcp4", "udp6", etc.)
func (*Mapper) String ¶
String returns a human-readable representation of the current mappings.
func (*Mapper) UnregisterIPPortIdentity ¶
UnregisterIPPortIdentity removes a temporary IP:port registration made previously by RegisterIPPortIdentity.
func (*Mapper) WhoIsIPPort ¶
WhoIsIPPort looks up an IP:port in the temporary registrations, and returns a matching Tailscale IP, if it exists.
Source Files ¶
proxymap.go
- Version
- v1.84.0 (latest)
- Published
- May 21, 2025
- Platform
- linux/amd64
- Imports
- 6 packages
- Last checked
- 1 day ago –
Tools for package owners.