client

package
v0.0.0-...-5f124ca Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2022 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UNORDERED_FLAG = 0x01 // 0000 0001
)

Variables

This section is empty.

Functions

func MakeSession

func MakeSession(connConfig RemoteConnConfig, authInfo AuthInfo, dialer common.Dialer) *mux.Session

On different invocations to MakeSession, authInfo.SessionId MUST be different

func RouteTCP

func RouteTCP(listener net.Listener, streamTimeout time.Duration, singleplex bool, newSeshFunc func() *mux.Session)

func RouteUDP

func RouteUDP(bindFunc func() (*net.UDPConn, error), streamTimeout time.Duration, singleplex bool, newSeshFunc func() *mux.Session)

Types

type AuthInfo

type AuthInfo struct {
	UID              []byte
	SessionId        uint32
	ProxyMethod      string
	EncryptionMethod byte
	Unordered        bool
	ServerPubKey     crypto.PublicKey
	MockDomain       string
	WorldState       common.WorldState
}

type Chrome

type Chrome struct{}

type DirectTLS

type DirectTLS struct {
	*common.TLSConn
	// contains filtered or unexported fields
}

func (*DirectTLS) Handshake

func (tls *DirectTLS) Handshake(rawConn net.Conn, authInfo AuthInfo) (sessionKey [32]byte, err error)

NewClientTransport handles the TLS handshake for a given conn and returns the sessionKey if the server proceed with Cloak authentication

type Firefox

type Firefox struct{}

type LocalConnConfig

type LocalConnConfig struct {
	LocalAddr      string
	Timeout        time.Duration
	MockDomainList []string
}

type RawConfig

type RawConfig struct {
	ServerName       string
	ProxyMethod      string
	EncryptionMethod string
	UID              []byte
	PublicKey        []byte
	NumConn          int
	LocalHost        string   // jsonOptional
	LocalPort        string   // jsonOptional
	RemoteHost       string   // jsonOptional
	RemotePort       string   // jsonOptional
	AlternativeNames []string // jsonOptional
	// defaults set in ProcessRawConfig
	UDP           bool   // nullable
	BrowserSig    string // nullable
	Transport     string // nullable
	CDNOriginHost string // nullable
	StreamTimeout int    // nullable
	KeepAlive     int    // nullable
}

RawConfig represents the fields in the config json file nullable means if it's empty, a default value will be chosen in ProcessRawConfig jsonOptional means if the json's empty, its value will be set from environment variables or commandline args but it mustn't be empty when ProcessRawConfig is called

func ParseConfig

func ParseConfig(conf string) (raw *RawConfig, err error)

func (*RawConfig) ProcessRawConfig

func (raw *RawConfig) ProcessRawConfig(worldState common.WorldState) (local LocalConnConfig, remote RemoteConnConfig, auth AuthInfo, err error)

type RemoteConnConfig

type RemoteConnConfig struct {
	Singleplex     bool
	NumConn        int
	KeepAlive      time.Duration
	RemoteAddr     string
	TransportMaker func() Transport
}

type Transport

type Transport interface {
	Handshake(rawConn net.Conn, authInfo AuthInfo) (sessionKey [32]byte, err error)
	net.Conn
}

type WSOverTLS

type WSOverTLS struct {
	*common.WebSocketConn
	// contains filtered or unexported fields
}

func (*WSOverTLS) Close

func (ws *WSOverTLS) Close() error

func (*WSOverTLS) Handshake

func (ws *WSOverTLS) Handshake(rawConn net.Conn, authInfo AuthInfo) (sessionKey [32]byte, err error)

Jump to

Keyboard shortcuts

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