proxymap

package
v1.64.1 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: BSD-3-Clause Imports: 4 Imported by: 2

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(ipport netip.AddrPort, tsIP netip.Addr)

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.

func (*Mapper) UnregisterIPPortIdentity

func (m *Mapper) UnregisterIPPortIdentity(ipport netip.AddrPort)

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

func (*Mapper) WhoIsIPPort

func (m *Mapper) WhoIsIPPort(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