proxy_client

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2018 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RELAY_TCP_RETRY = "Kcp relay tcp failed when write header"
)
View Source
const (
	SCAVENGER_COUNT = 128
)

Variables

This section is empty.

Functions

func CreateProxyBackend

func CreateProxyBackend(remoteServerConfig config.RemoteServerConfig) (ret *proxyBackend, err error)

func NewUDPBackend

func NewUDPBackend() *udpBackend

Types

type KCPBackend

type KCPBackend struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func StartKCPBackend

func StartKCPBackend(config config.KcptunConfig, crypt string, password string) (ret *KCPBackend, err error)

func (*KCPBackend) GetKcpConn

func (c *KCPBackend) GetKcpConn() (*smux.Stream, error)

func (*KCPBackend) Stop

func (c *KCPBackend) Stop()

type ProxyClient

type ProxyClient struct {
	// contains filtered or unexported fields
}

func StartProxyClient

func StartProxyClient(dnsMockTimeout int, config config.ShadowsocksConfig, listenAddr string) (*ProxyClient, error)

func (*ProxyClient) ExchangeDNS

func (c *ProxyClient) ExchangeDNS(dnsAddr string, data []byte, timeout time.Duration) (response *dns.Msg, err error)

func (*ProxyClient) GetUDPBuffer

func (c *ProxyClient) GetUDPBuffer() []byte

func (*ProxyClient) HandleUDP

func (c *ProxyClient) HandleUDP(buffer []byte, srcAddr *net.UDPAddr, dstAddr *net.UDPAddr, dataLen int)

func (*ProxyClient) PutUDPBuffer

func (c *ProxyClient) PutUDPBuffer(buffer []byte)

func (*ProxyClient) RelayUDPData

func (c *ProxyClient) RelayUDPData(srcAddr *net.UDPAddr, dstAddr *net.UDPAddr, data []byte, dataLen int) error

func (*ProxyClient) ReloadBackend

func (c *ProxyClient) ReloadBackend(dnsMockTimeout int, serverConfig config.ShadowsocksConfig) (err error)

func (*ProxyClient) SetDNSProcessor

func (c *ProxyClient) SetDNSProcessor(server common.DNSServerInterface)

func (*ProxyClient) StartBackend

func (c *ProxyClient) StartBackend(serverConfig config.ShadowsocksConfig) (err error)

func (*ProxyClient) Stop

func (c *ProxyClient) Stop()

Jump to

Keyboard shortcuts

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