Documentation ¶
Index ¶
- Variables
- func Base64Decode(src []byte) ([]byte, error)
- func Base64Encode(src []byte) []byte
- func Drain(conn net.Conn)
- func HTTPProtocolHeader(domain string) []byte
- func HandlePanic()
- func Ping(c net.Conn) (result bool)
- func Pipe(src, dst net.Conn)
- func Pour(conn net.Conn, data []byte)
- func RawAddr(domain string, port uint16) []byte
- func ReadStream(conn net.Conn) *bytes.Buffer
- type Cipher
- type Config
- type Conn
- type DecOrEnc
- type Queue
- type Socks5Negotiation
- type Socks5Request
- type Traffic
- type TrafficType
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ReadTimeout time.Duration
)
Functions ¶
Types ¶
type Cipher ¶
type Cipher struct {
// contains filtered or unexported fields
}
Cipher - crypto struct
type Config ¶
type Config struct { LocalAddr string `json:"local"` ServerAddr string `json:"server"` Password string `json:"password"` Method string `json:"method"` Timeout int `json:"timeout"` TargetDomain string `json:"target_domain"` TargetPort uint16 `json:"target_port"` }
func ParseConfig ¶
type Conn ¶
func ConnectToServer ¶
func ConnectToServer(network, addr string, tp TrafficType, rawaddr []byte, cipher *Cipher) (c *Conn, err error)
ConnectToServer write rawaddr to server
func (*Conn) SetReadTimeout ¶
func (c *Conn) SetReadTimeout()
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
Queue for generic purpose
type Socks5Negotiation ¶
func (*Socks5Negotiation) String ¶
func (s *Socks5Negotiation) String() string
type Socks5Request ¶
type Socks5Request struct { Version uint8 Command uint8 RSV uint8 AddressType uint8 Address string Port uint16 AddressWithPort string RawAddr []byte }
func (*Socks5Request) String ¶
func (s *Socks5Request) String() string
type Traffic ¶
type Traffic struct { Type TrafficType PayloadLen uint16 // length of payload Payload []byte // rawaddr }
Traffic represent traffic throughout c/s
func NewTraffic ¶
func NewTraffic(tp TrafficType, payload []byte) (r *Traffic)
NewTraffic payload stand for: rawaddr + payload
func UnMarshalTraffic ¶
UnMarshalTraffic unmarshal TNTrequest via conn
type TrafficType ¶
type TrafficType uint8
TrafficType 0: meaningless, 1: request, 2: response, other: invalid
const ( TrafficMeaningless TrafficType = iota TrafficRequest )
Source Files ¶
Click to show internal directories.
Click to hide internal directories.