proxymap

package
v1.104.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 27, 2026 License: BSD-3-Clause Imports: 6 Imported by: 3 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package proxymap contains a mapping table for ephemeral localhost ports used by tailscaled on behalf of remote Tailscale IPs for proxied connections.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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

func (m *Mapper) RegisterIPPortIdentity(proto string, ipport netip.AddrPort, tsIP netip.Addr) error

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 added in v1.74.0

func (m *Mapper) String() string

String returns a human-readable representation of the current mappings.

func (*Mapper) UnregisterIPPortIdentity

func (m *Mapper) UnregisterIPPortIdentity(proto string, ipport netip.AddrPort)

UnregisterIPPortIdentity removes a temporary IP:port registration made previously by RegisterIPPortIdentity.

func (*Mapper) WhoIsIPPort

func (m *Mapper) WhoIsIPPort(proto string, ipport netip.AddrPort) (tsIP netip.Addr, ok bool)

WhoIsIPPort looks up an IP:port in the temporary registrations, and returns a matching Tailscale IP, if it exists.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL