Documentation ¶
Overview ¶
*
- Created with IntelliJ IDEA.
- User: clowwindy
- Date: 12-11-2
- Time: 上午10:31
- To change this template use File | Settings | File Templates.
Provides leaky buffer, based on the example in Effective Go.
Index ¶
- Constants
- func CheckCipherMethod(method string) error
- func HmacSha1(key []byte, data []byte) []byte
- func IsFileExists(path string) (bool, error)
- func PipeThenClose(src, dst net.Conn)
- func PipeThenCloseOta(src *Conn, dst net.Conn)
- func PrintVersion()
- func RawAddr(addr string) (buf []byte, err error)
- func SetDebug(d DebugLog)
- func SetReadTimeout(c net.Conn)
- func Sort(arr []uint64, comparison func(uint64, uint64) int64) []uint64
- func UpdateConfig(old, new *Config)
- type Cipher
- type ClosedFlag
- type Config
- type Conn
- type DebugLog
- type DecOrEnc
- type LeakyBuf
Constants ¶
View Source
const ( OneTimeAuthMask byte = 0x10 AddrMask byte = 0xf )
Variables ¶
This section is empty.
Functions ¶
func CheckCipherMethod ¶
func IsFileExists ¶
func PipeThenClose ¶
PipeThenClose copies data from src to dst, closes dst when done.
func PipeThenCloseOta ¶
PipeThenClose copies data from src to dst, closes dst when done, with ota verification.
func PrintVersion ¶
func PrintVersion()
func SetReadTimeout ¶
func UpdateConfig ¶
func UpdateConfig(old, new *Config)
Useful for command line to override options specified in config file Debug is not updated.
Types ¶
type Cipher ¶
type Cipher struct {
// contains filtered or unexported fields
}
type ClosedFlag ¶
type ClosedFlag struct {
// contains filtered or unexported fields
}
func (*ClosedFlag) IsClosed ¶
func (flag *ClosedFlag) IsClosed() bool
func (*ClosedFlag) SetClosed ¶
func (flag *ClosedFlag) SetClosed()
type Config ¶
type Config struct { Server interface{} `json:"server"` ServerPort int `json:"server_port"` LocalPort int `json:"local_port"` Password string `json:"password"` Method string `json:"method"` // encryption method Auth bool `json:"auth"` // one time auth // following options are only used by server PortPassword map[string]string `json:"port_password"` Timeout int `json:"timeout"` // The order of servers in the client config is significant, so use array // instead of map to preserve the order. ServerPassword [][]string `json:"server_password"` }
func ParseConfig ¶
func (*Config) GetServerArray ¶
type Conn ¶
func DialWithRawAddr ¶
This is intended for use by users implementing a local socks proxy. rawaddr shoud contain part of the data in socks request, starting from the ATYP field. (Refer to rfc1928 for more information.)
func (*Conn) GetAndIncrChunkId ¶
Click to show internal directories.
Click to hide internal directories.