Versions in this module Expand all Collapse all v0 v0.0.3 Aug 8, 2024 v0.0.2 Aug 8, 2024 Changes in this version + const MaxCapacity + func StreamServe(accept StreamListener, handle StreamHandler) + type CipherEntry struct + CryptoKey *shadowsocks.EncryptionKey + ID string + SaltGenerator ServerSaltGenerator + func MakeCipherEntry(id string, cryptoKey *shadowsocks.EncryptionKey, secret string) CipherEntry + type CipherList interface + MarkUsedByClientIP func(e *list.Element, clientIP netip.Addr) + SnapshotForClientIP func(clientIP netip.Addr) []*list.Element + Update func(contents *list.List) + func MakeTestCiphers(secrets []string) (CipherList, error) + func NewCipherList() CipherList + type NoOpTCPMetrics struct + func (m *NoOpTCPMetrics) AddAuthenticatedTCPConnection(clientAddr net.Addr, accessKey string) + func (m *NoOpTCPMetrics) AddClosedTCPConnection(clientInfo ipinfo.IPInfo, clientAddr net.Addr, accessKey string, status string, ...) + func (m *NoOpTCPMetrics) AddOpenTCPConnection(clientInfo ipinfo.IPInfo) + func (m *NoOpTCPMetrics) AddTCPCipherSearch(accessKeyFound bool, timeToCipher time.Duration) + func (m *NoOpTCPMetrics) AddTCPProbe(status, drainResult string, listenerId string, clientProxyBytes int64) + func (m *NoOpTCPMetrics) GetIPInfo(net.IP) (ipinfo.IPInfo, error) + type NoOpUDPMetrics struct + func (m *NoOpUDPMetrics) AddUDPCipherSearch(accessKeyFound bool, timeToCipher time.Duration) + func (m *NoOpUDPMetrics) AddUDPNatEntry(clientAddr net.Addr, accessKey string) + func (m *NoOpUDPMetrics) AddUDPPacketFromClient(clientInfo ipinfo.IPInfo, accessKey, status string, ...) + func (m *NoOpUDPMetrics) AddUDPPacketFromTarget(clientInfo ipinfo.IPInfo, accessKey, status string, ...) + func (m *NoOpUDPMetrics) GetIPInfo(net.IP) (ipinfo.IPInfo, error) + func (m *NoOpUDPMetrics) RemoveUDPNatEntry(clientAddr net.Addr, accessKey string) + type PacketHandler interface + Handle func(clientConn net.PacketConn) + SetTargetIPValidator func(targetIPValidator onet.TargetIPValidator) + func NewPacketHandler(natTimeout time.Duration, cipherList CipherList, m UDPMetrics) PacketHandler + type ReplayCache struct + func NewReplayCache(capacity int) ReplayCache + func (c *ReplayCache) Add(id string, salt []byte) bool + type ServerSaltGenerator interface + IsServerSalt func(salt []byte) bool + var RandomServerSaltGenerator ServerSaltGenerator = randomServerSaltGenerator{} + func NewServerSaltGenerator(secret string) ServerSaltGenerator + type ShadowsocksTCPMetrics interface + AddTCPCipherSearch func(accessKeyFound bool, timeToCipher time.Duration) + type StreamAuthenticateFunc func(clientConn transport.StreamConn) (string, transport.StreamConn, *onet.ConnectionError) + func NewShadowsocksStreamAuthenticator(ciphers CipherList, replayCache *ReplayCache, metrics ShadowsocksTCPMetrics, ...) StreamAuthenticateFunc + type StreamHandler func(ctx context.Context, conn transport.StreamConn) + type StreamListener func() (transport.StreamConn, error) + func WrapStreamListener[T transport.StreamConn](f func() (T, error)) StreamListener + type TCPHandler interface + Handle func(ctx context.Context, conn transport.StreamConn) + SetTargetDialer func(dialer transport.StreamDialer) + func NewTCPHandler(authenticate StreamAuthenticateFunc, m TCPMetrics, timeout time.Duration, ...) TCPHandler + type TCPMetrics interface + AddAuthenticatedTCPConnection func(clientAddr net.Addr, accessKey string) + AddClosedTCPConnection func(clientInfo ipinfo.IPInfo, clientAddr net.Addr, accessKey string, status string, ...) + AddOpenTCPConnection func(clientInfo ipinfo.IPInfo) + AddTCPProbe func(status, drainResult string, listenerId string, clientProxyBytes int64) + type UDPMetrics interface + AddUDPCipherSearch func(accessKeyFound bool, timeToCipher time.Duration) + AddUDPNatEntry func(clientAddr net.Addr, accessKey string) + AddUDPPacketFromClient func(clientInfo ipinfo.IPInfo, accessKey, status string, ...) + AddUDPPacketFromTarget func(clientInfo ipinfo.IPInfo, accessKey, status string, ...) + RemoveUDPNatEntry func(clientAddr net.Addr, accessKey string)