Documentation
¶
Index ¶
- Variables
- type Config
- type Gateway
- type Mapping
- type MappingTable
- func (mt *MappingTable) All() []Mapping
- func (mt *MappingTable) Lookup(localIP net.IP) (protocol.Addr, bool)
- func (mt *MappingTable) Map(pilotAddr protocol.Addr, localIP net.IP) (net.IP, error)
- func (mt *MappingTable) ReverseLookup(addr protocol.Addr) (net.IP, bool)
- func (mt *MappingTable) Unmap(localIP net.IP) error
Constants ¶
This section is empty.
Variables ¶
var DefaultPorts = []uint16{80, 443, 1000, 1001, 1002, 7, 8080, 8443}
DefaultPorts is the default set of ports the gateway proxies.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Subnet string // CIDR subnet for local IPs (default: "10.4.0.0/16")
SocketPath string // Daemon socket path
Ports []uint16 // Ports to proxy (default: DefaultPorts)
}
Config configures the gateway.
type Gateway ¶
type Gateway struct {
// contains filtered or unexported fields
}
Gateway bridges standard IP/TCP traffic to the Pilot Protocol overlay. In proxy mode, it listens on mapped local IPs and forwards TCP connections through Pilot Protocol streams.
func (*Gateway) Map ¶
Map registers a Pilot address and starts proxying for it. If localIP is empty, one is auto-assigned from the subnet.
func (*Gateway) Mappings ¶
func (gw *Gateway) Mappings() *MappingTable
Mappings returns the mapping table for external use.
type MappingTable ¶
type MappingTable struct {
// contains filtered or unexported fields
}
MappingTable maps local IPs to Pilot addresses and vice versa.
func NewMappingTable ¶
func NewMappingTable(cidr string) (*MappingTable, error)
NewMappingTable creates a mapping table for the given subnet (e.g. "10.4.0.0/16").
func (*MappingTable) All ¶
func (mt *MappingTable) All() []Mapping
func (*MappingTable) Map ¶
Map registers a mapping between a Pilot address and a local IP. If localIP is nil, the next available IP in the subnet is assigned.
func (*MappingTable) ReverseLookup ¶
ReverseLookup returns the local IP for a Pilot address.