Documentation
¶
Index ¶
Constants ¶
View Source
const UpgradeProto = "UoTLV/1"
UpgradeProto is the protocol used in HTTP Upgrade UoTLV/1 is UDP over TCP Length Value version 1
Variables ¶
View Source
var ErrReaderTimeout = errors.New("TCP reader timeout reached")
Functions ¶
func Server ¶
Server creates a server that forwards TCP to UDP wgp is the WireGuard port tcpp is the TCP listening port to is the IP:PORT string
func UpdateLogger ¶
func UpdateLogger(l Logger)
Types ¶
type Client ¶
type Client struct { // Listen is the PORT for the UDP listener ListenPort int // TCPSourcePort is the source port for the TCP connection TCPSourcePort int // Fwmark sets the SO_MARK to use // Set to 0 or negative to disable // This is only set on Linux Fwmark int // Peer is the peer to connect to Peer string // PeerIPS is the list of DNS resolved IPs for the Peer // You may leave this empty and automatically resolve PeerIPs using // `Setup` PeerIPS []string // SetupSocket is called when the socket is setting up // fd is the file descriptor of the socket SetupSocket func(fd int) // UserAgent is the HTTP user agent to use for HTTP requests UserAgent string // contains filtered or unexported fields }
Client represents a ProxyGuard client
func (*Client) Close ¶
func (c *Client) Close()
Close closes the underlying UDP connection to WireGuard
func (*Client) Setup ¶
Setup makes sure the client has a UDP socket and caches the DNS for the Proxy endpoint It returns the UDP port the client is listening on, this is useful to know if the Client's ListenPort was left on zero This function has to be called before `Tunnel` When a client is done it has to call `Close` if this function has returned no error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.