Versions in this module Expand all Collapse all v0 v0.0.5 Jun 20, 2024 v0.0.4 Jun 20, 2024 v0.0.2 Jun 20, 2024 v0.0.1 Jun 20, 2024 Changes in this version + const DEFAULT_DOWNSTREAM_PACKET_QUEUE_SIZE + const DEFAULT_IDLE_SESSION_EXPIRY_SECONDS + const DEFAULT_MTU + const DEFAULT_PUBLIC_INTERFACE_NAME + const DEFAULT_UPSTREAM_PACKET_QUEUE_SIZE + const FLOW_IDLE_EXPIRY + const ORPHAN_METRICS_CHECKPOINTER_PERIOD + func BindToDevice(_ int, _ string) error — js/wasm, windows/amd64 + func BindToDevice(fd int, deviceName string) error — darwin/amd64, linux/amd64 + func IsSupported() bool + func OpenTunDevice(_ string) (*os.File, string, error) — js/wasm, windows/amd64 + func OpenTunDevice(name string) (*os.File, string, error) — darwin/amd64, linux/amd64 + type AllowedDomainChecker func(string) bool + type AllowedPortChecker func(upstreamIPAddress net.IP, port int) bool + type Channel struct + func NewChannel(transport io.ReadWriteCloser, MTU int) *Channel + func (channel *Channel) Close() error + func (channel *Channel) ReadPacket() ([]byte, error) + func (channel *Channel) WriteFramedPackets(packetBuffer []byte) error + func (channel *Channel) WritePacket(packet []byte) error + type Client struct + func NewClient(config *ClientConfig) (*Client, error) + func (client *Client) Start() + func (client *Client) Stop() + type ClientConfig struct + AllowNoIPv6NetworkConfiguration bool + IPv4AddressCIDR string + IPv6AddressCIDR string + Logger common.Logger + MTU int + RouteDestinations []string + SudoNetworkConfigCommands bool + TransparentDNSIPv4Address string + TransparentDNSIPv6Address string + Transport io.ReadWriteCloser + TunFileDescriptor int + UpstreamPacketQueueSize int + type DNSQualityReporter func(receivedResponse bool, requestDuration time.Duration, resolverIP net.IP) + type Device struct + func NewClientDevice(config *ClientConfig) (*Device, error) + func NewClientDeviceFromFD(config *ClientConfig) (*Device, error) + func NewServerDevice(config *ServerConfig) (*Device, error) + func (device *Device) Close() error + func (device *Device) Name() string + func (device *Device) ReadPacket() ([]byte, error) + func (device *Device) WritePacket(packet []byte) error + type FlowActivityUpdater interface + UpdateProgress func(downstreamBytes, upstreamBytes, durationNanoseconds int64) + type FlowActivityUpdaterMaker func(isTCP bool, upstreamHostname string, upstreamIPAddress net.IP) []FlowActivityUpdater + type MetricsUpdater func(...) + type PacketQueue struct + func NewPacketQueue(maxSize int) *PacketQueue + func (queue *PacketQueue) DequeueFramedPackets(runContext context.Context) ([]byte, bool) + func (queue *PacketQueue) Enqueue(packet []byte) + func (queue *PacketQueue) Replace(buffer []byte) + type Server struct + func NewServer(config *ServerConfig) (*Server, error) + func (server *Server) ClientConnected(sessionID string, transport io.ReadWriteCloser, ...) error + func (server *Server) ClientDisconnected(sessionID string) + func (server *Server) Start() + func (server *Server) Stop() + type ServerConfig struct + AllowBogons bool + AllowNoIPv6NetworkConfiguration bool + DownstreamPacketQueueSize int + EgressInterface string + EnableDNSFlowTracking bool + GetDNSResolverIPv4Addresses func() []net.IP + GetDNSResolverIPv6Addresses func() []net.IP + Logger common.Logger + MTU int + SessionIdleExpirySeconds int + SudoNetworkConfigCommands bool