ss

package
v0.0.0-...-d305f05 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const AEADCipher = "AEAD_CHACHA20_POLY1305"

Variables

View Source
var ServerConfig struct {
	Verbose    bool
	UDPTimeout time.Duration
	TCPCork    bool // coalesce writing first few packets
}

controls ss server

Functions

func ParseSSURL

func ParseSSURL(s string) (addr, cipher, password string, err error)

ParseSSURL parse ss:// URL, eg. ss://AEAD_CHACHA20_POLY1305:your-password@[server_address]:8488

func SSMain

func SSMain(ss_config *SSConfig) (err error)

Start shadowsocks server / client server_addr: addr of shadowsocks server socks_addr: addr of the local socks5 proxy started by shadowsocks client

Types

type SSConfig

type SSConfig struct {
	ServerAddr     string // ss server address
	LocalSocksAddr string // ss client local socks address, leave empty to disable
	Cipher         string // ss cipher, AEAD_CHACHA20_POLY1305
	Password       string // ss password
	IsServer       bool   // is ss server or client or tunnel
	Verbose        bool   // verbose logging

	// Tunnels: eg. :8053=8.8.8.8:53,:8054=8.8.4.4:53
	// (client-only) tunnel (local_addr1=remote_addr1,local_addr2=remote_addr2,...)
	TCPTun string
	UDPTun string

	// used as switch
	Ctx    context.Context
	Cancel context.CancelFunc
}

SSConfig start ss server/client with this config

Jump to

Keyboard shortcuts

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