client

package
v0.0.0-...-72c0b7d Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAddr

func NewAddr(address, network string) net.Addr

NewAddr returns a net.Addr that holds an address of the form `host:port` with a domain name or IP as host. Used for SOCKS addressing.

Types

type Client

type Client interface {
	// DialTCP connects to `raddr` over TCP though a Shadowsocks proxy.
	// `laddr` is a local bind address, a local address is automatically chosen if nil.
	// `raddr` has the form `host:port`, where `host` can be a domain name or IP address.
	DialTCP(laddr *net.TCPAddr, raddr string) (onet.DuplexConn, error)

	// ListenUDP relays UDP packets though a Shadowsocks proxy.
	// `laddr` is a local bind address, a local address is automatically chosen if nil.
	ListenUDP(laddr *net.UDPAddr) (net.PacketConn, error)
}

Client is a client for Shadowsocks TCP and UDP connections.

func NewClient

func NewClient(host string, port int, password, cipherName string) (Client, error)

NewClient creates a client that routes connections to a Shadowsocks proxy listening at `host:port`, with authentication parameters `cipher` (AEAD) and `password`. TODO: add a dialer argument to support proxy chaining and transport changes.

Jump to

Keyboard shortcuts

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