ss

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 4, 2024 License: GPL-3.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CONNECT = iota + 1
	BIND
	UDP
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

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

func NewAuth

func NewAuth(username, password string) *Auth

func (*Auth) Password

func (a *Auth) Password() string

func (*Auth) String

func (a *Auth) String() string

func (*Auth) UserInfo

func (a *Auth) UserInfo() *url.Userinfo

func (*Auth) Username

func (a *Auth) Username() string

func (*Auth) Validate

func (a *Auth) Validate(username, password string) bool

type SSOption

type SSOption interface {
	// contains filtered or unexported methods
}

func WithAutoDetectInterface

func WithAutoDetectInterface(enable bool) SSOption

func WithDefaultDnsNameservers

func WithDefaultDnsNameservers(ns []string) SSOption

WithDefaultDnsNameservers default dns nameservers

func WithDefaultTransport

func WithDefaultTransport() SSOption

func WithEnableSSR

func WithEnableSSR() SSOption

WithEnableSSR whether to support SSR connection for example "ss" or "ssr", default "ss"

func WithEnableTun

func WithEnableTun() SSOption

WithEnableTun enable tun mode (client-only)

func WithFakeDnsDisableRewrite

func WithFakeDnsDisableRewrite(disable bool) SSOption

func WithFakeDnsServer

func WithFakeDnsServer(addr string) SSOption

func WithGrpcCAPath

func WithGrpcCAPath(caFile string) SSOption

func WithGrpcCertPath

func WithGrpcCertPath(certFile string) SSOption

func WithGrpcHostname

func WithGrpcHostname(hostname string) SSOption

func WithGrpcKeyPath

func WithGrpcKeyPath(keyFile string) SSOption

func WithGrpcSndRevBuffer

func WithGrpcSndRevBuffer(sndBuffer, revBuffer int) SSOption

func WithGrpcTLS

func WithGrpcTLS(mode transport.TlsMode) SSOption

func WithGrpcTransport

func WithGrpcTransport() SSOption

func WithHttpAddr

func WithHttpAddr(addr string) SSOption

func WithHttpUserInfo

func WithHttpUserInfo(username, password string) SSOption

func WithKcpAckNoDelay

func WithKcpAckNoDelay() SSOption

func WithKcpCompress

func WithKcpCompress() SSOption

func WithKcpConns

func WithKcpConns(conns int) SSOption

func WithKcpCrypt

func WithKcpCrypt(crypt string) SSOption

WithKcpCrypt support: none, aes-128, aes-192, salsa20, blowfish, twofish, cast5, 3des, tea, xtea, xor, sm4

func WithKcpDataShard

func WithKcpDataShard(dataShard int) SSOption

func WithKcpDscp

func WithKcpDscp(dscp int) SSOption

func WithKcpInterval

func WithKcpInterval(interval int) SSOption

func WithKcpKeepAlive

func WithKcpKeepAlive(second int) SSOption

func WithKcpKey

func WithKcpKey(key string) SSOption

func WithKcpMTU

func WithKcpMTU(mtu int) SSOption

func WithKcpMode

func WithKcpMode(mode string) SSOption

WithKcpMode fast3, fast2, fast, normal, manual

func WithKcpNc

func WithKcpNc(nc int) SSOption

func WithKcpNoDelay

func WithKcpNoDelay(noDelay int) SSOption

WithKcpNoDelay NoDelay options fastest: ikcp_nodelay(kcp, 1, 20, 2, 1) nodelay: 0:disable(default), 1:enable interval: internal update timer interval in millisec, default is 100ms resend: 0:disable fast resend(default), 1:enable fast resend nc: 0:normal congestion control(default), 1:disable congestion control

func WithKcpParityShard

func WithKcpParityShard(parityShard int) SSOption

func WithKcpResend

func WithKcpResend(resend int) SSOption

func WithKcpSmuxBuf

func WithKcpSmuxBuf(smuxBuf int) SSOption

func WithKcpSmuxVer

func WithKcpSmuxVer(smuxVer int) SSOption

func WithKcpSndRevWnd

func WithKcpSndRevWnd(sndWnd, revWnd int) SSOption

func WithKcpSockBuf

func WithKcpSockBuf(sockBuf int) SSOption

func WithKcpStreamBuf

func WithKcpStreamBuf(streamBuf int) SSOption

func WithKcpTransport

func WithKcpTransport() SSOption

func WithMethod

func WithMethod(method string) SSOption

func WithMitm

func WithMitm(enable bool) SSOption

func WithMitmCAPath

func WithMitmCAPath(caPath string) SSOption

func WithMitmFakeCertPool

func WithMitmFakeCertPool(capacity, interval, expireSecond int) SSOption

func WithMitmKeyPath

func WithMitmKeyPath(keyPath string) SSOption

func WithMixedAddr

func WithMixedAddr(addr string) SSOption

WithMixedAddr mixed proxy ports (SOCKS and HTTP)

func WithObfsHost

func WithObfsHost(host string) SSOption

func WithObfsParam

func WithObfsParam(param string) SSOption

func WithObfsTransport

func WithObfsTransport() SSOption

func WithOutboundInterface

func WithOutboundInterface(ifaceName string) SSOption

WithOutboundInterface set the outgoing interface name

func WithPassword

func WithPassword(password string) SSOption

func WithQuicCAPath

func WithQuicCAPath(caFile string) SSOption

func WithQuicCertPath

func WithQuicCertPath(certFile string) SSOption

func WithQuicConns

func WithQuicConns(conns int) SSOption

func WithQuicHandshakeIdleTimeout

func WithQuicHandshakeIdleTimeout(timeout time.Duration) SSOption

func WithQuicHostname

func WithQuicHostname(hostname string) SSOption

func WithQuicKeepAlivePeriod

func WithQuicKeepAlivePeriod(timeout time.Duration) SSOption

func WithQuicKeyPath

func WithQuicKeyPath(keyFile string) SSOption

func WithQuicMaxIdleTimeout

func WithQuicMaxIdleTimeout(timeout time.Duration) SSOption

func WithQuicTLS

func WithQuicTLS(mode transport.TlsMode) SSOption

func WithQuicTransport

func WithQuicTransport() SSOption

func WithRuler

func WithRuler(ruler *rule.Ruler) SSOption

func WithSSRObfs

func WithSSRObfs(name string) SSOption

WithSSRObfs ssr obfs name support obfs plugins: - plain - http_simple - http_post - random_head - tls1.2_ticket_auth - tls1.2_ticket_auth_compatible

func WithSSRProtocol

func WithSSRProtocol(name string) SSOption

WithSSRProtocol ssr protocol name support protocol plugins: - origin - auth_sha1_v4 - auth_aes128_md5 - auth_aes128_sha1 - auth_chain_a - auth_chain_b

func WithSSRProtocolParam

func WithSSRProtocolParam(param string) SSOption

func WithServerAddr

func WithServerAddr(addr string) SSOption

func WithServerCompose

func WithServerCompose(opts ...SSOption) SSOption

func WithServerName

func WithServerName(name string) SSOption

func WithSocksAddr

func WithSocksAddr(addr string) SSOption

func WithSocksUserInfo

func WithSocksUserInfo(username, password string) SSOption

func WithSystemProxy

func WithSystemProxy() SSOption

WithSystemProxy whether to enable system proxy (for Linux, only Ubuntu and KDE are supported)

func WithTcpTunAddr

func WithTcpTunAddr(addrs [][]string) SSOption

func WithTunCIDR

func WithTunCIDR(cidr string) SSOption

func WithTunMTU

func WithTunMTU(mtu uint32) SSOption

func WithTunName

func WithTunName(name string) SSOption

func WithUDPRelay

func WithUDPRelay(enable bool) SSOption

func WithWsCAPath

func WithWsCAPath(caFile string) SSOption

func WithWsCertPath

func WithWsCertPath(certFile string) SSOption

func WithWsCompress

func WithWsCompress() SSOption

func WithWsHost

func WithWsHost(host string) SSOption

func WithWsHostname

func WithWsHostname(hostname string) SSOption

func WithWsKeyPath

func WithWsKeyPath(keyFile string) SSOption

func WithWsPath

func WithWsPath(path string) SSOption

func WithWsSndRevBuffer

func WithWsSndRevBuffer(sndBuffer, revBuffer int) SSOption

func WithWsTLS

func WithWsTLS(mode transport.TlsMode) SSOption

func WithWsTransport

func WithWsTransport() SSOption

func WithWsUserAgent

func WithWsUserAgent(userAgent string) SSOption

type ShadowsocksClient

type ShadowsocksClient struct {
	Opts ssOptions
	// contains filtered or unexported fields
}

func NewShadowsocksClient

func NewShadowsocksClient(opts ...SSOption) *ShadowsocksClient

func (*ShadowsocksClient) Close

func (ss *ShadowsocksClient) Close() error

func (*ShadowsocksClient) Start

func (ss *ShadowsocksClient) Start() error

type ShadowsocksServer

type ShadowsocksServer struct {
	Opts ssOptions
	// contains filtered or unexported fields
}

func NewShadowsocksServer

func NewShadowsocksServer(opts ...SSOption) *ShadowsocksServer

func (*ShadowsocksServer) Close

func (ss *ShadowsocksServer) Close() error

func (*ShadowsocksServer) Start

func (ss *ShadowsocksServer) Start() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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