ss

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2022 License: GPL-3.0 Imports: 12 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSSDialer

func NewSSDialer(s string, d proxy.Dialer) (proxy.Dialer, error)

NewSSDialer returns a ss proxy dialer.

func NewSSServer

func NewSSServer(s string, p proxy.Proxy) (proxy.Server, error)

NewSSServer returns a ss proxy server.

Types

type PktConn

type PktConn struct {
	net.PacketConn
	// contains filtered or unexported fields
}

PktConn .

func NewPktConn

func NewPktConn(c net.PacketConn, writeAddr net.Addr, targetAddr socks.Addr) *PktConn

NewPktConn returns a PktConn, the writeAddr must be *net.UDPAddr or *net.UnixAddr.

func (*PktConn) ReadFrom

func (pc *PktConn) ReadFrom(b []byte) (int, net.Addr, error)

ReadFrom overrides the original function from net.PacketConn.

func (*PktConn) WriteTo

func (pc *PktConn) WriteTo(b []byte, addr net.Addr) (int, error)

WriteTo overrides the original function from net.PacketConn

type SS

type SS struct {
	cipher.Cipher
	// contains filtered or unexported fields
}

SS is a base ss struct.

func NewSS

func NewSS(s string, d proxy.Dialer, p proxy.Proxy) (*SS, error)

NewSS returns a ss proxy.

func (*SS) Addr

func (s *SS) Addr() string

Addr returns forwarder's address.

func (*SS) Dial

func (s *SS) Dial(network, addr string) (net.Conn, error)

Dial connects to the address addr on the network net via the proxy.

func (*SS) DialUDP

func (s *SS) DialUDP(network, addr string) (net.PacketConn, error)

DialUDP connects to the given address via the proxy.

func (*SS) ListenAndServe

func (s *SS) ListenAndServe()

ListenAndServe serves ss requests.

func (*SS) ListenAndServeTCP

func (s *SS) ListenAndServeTCP()

ListenAndServeTCP serves tcp ss requests.

func (*SS) ListenAndServeUDP

func (s *SS) ListenAndServeUDP()

ListenAndServeUDP serves udp requests.

func (*SS) Serve added in v0.6.9

func (s *SS) Serve(c net.Conn)

Serve serves a connection.

func (*SS) ServePacket added in v0.16.0

func (s *SS) ServePacket(pc net.PacketConn)

ServePacket implementes proxy.PacketServer.

type Session added in v0.15.0

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

Session is a udp session

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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