clientlib

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: May 2, 2022 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CircuitDialer

func CircuitDialer(
	skf func() (*servicekey.T, error),
	circuitf func() ([]*relayentry.T, error),
	dialf func(net.Conn, string, *url.URL, *wlnet.Init) (net.Conn, error),
) func(string, string) (net.Conn, error)

func GetContractInfo

func GetContractInfo(cl *client.Client, sc *texturl.URL) (info *contractinfo.T, rl relaylist.T, err error)

func ListenH2C

func ListenH2C(addr string, tc *tls.Config, dialer DialFunc, errf func(error)) error

ListenH2C listens on the given address, waiting for h2c connection requests to dial through the circuit. The target protocol and address are supplied in the headers which allows using HPACK compression and immediate status feedback.

func ListenSOCKS

func ListenSOCKS(addr string, dialer DialFunc, errf func(error)) (err error)

handle everything SOCKSv5-related on the same address

func NewSKFromPof

func NewSKFromPof(cl *client.Client, skurl string, p *pof.T) (*servicekey.T, error)

func PickPofs

func PickPofs(pofs ...*pof.T) (r []*pof.T)

func PickSK

func PickSK(sks ...*servicekey.T) (sk *servicekey.T)

func ProxyTCP

func ProxyTCP(l net.Listener, dialer DialFunc, errf func(error), udpaddr net.Addr)

handle TCP socks connections

func ProxyUDP

func ProxyUDP(l net.PacketConn, dialer DialFunc, errf func(error))

handle UDP packets

func RefreshSK

func RefreshSK(fm fsdir.T, actf Activator) (sk *servicekey.T, err error)

func SaveContractInfo

func SaveContractInfo(fm fsdir.T, ci *contractinfo.T, rl relaylist.T) (err error)

func TraceOrigin

func TraceOrigin(err error, circ circuit.T) (r *relayentry.T)

Types

type Activator

type Activator func(*pof.T) (*servicekey.T, error)

type AlwaysFetchFunc

type AlwaysFetchFunc func() (*servicekey.T, error)

func AlwaysFetch

func AlwaysFetch(f SKSourceFunc) AlwaysFetchFunc

type DialFunc

type DialFunc func(string, string) (net.Conn, error)

type SKSourceFunc

type SKSourceFunc func(bool) (*servicekey.T, error)

func SKSource

func SKSource(fm fsdir.T, c *clientcfg.C, cl *client.Client) SKSourceFunc

function to get a fresh sk if at all possible

Jump to

Keyboard shortcuts

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