Documentation ¶
Overview ¶
Provides leaky buffer, based on the example in Effective Go.
Index ¶
- Constants
- Variables
- func CheckCipherMethod(method string) error
- func ParseHeader(addr net.Addr) ([]byte, int)
- func PipeThenClose(src, dst net.Conn, timeout time.Duration)
- func PipeThenCloseOta(src *Conn, dst net.Conn, timeout time.Duration)
- func Pipeloop(ss *UDPConn, srcaddr *net.UDPAddr, remote UDP)
- func RawAddr(addr string) (buf []byte, err error)
- func SetReadTimeout(c net.Conn, timeout time.Duration)
- type CachedUDPConn
- type Cipher
- type Conn
- type DecOrEnc
- type LeakyBuf
- type NATlist
- type ReqNode
- type UDP
- type UDPConn
Constants ¶
View Source
const ( OneTimeAuthMask byte = 0x10 AddrMask byte = 0xf )
Variables ¶
View Source
var ReqList = map[string]*ReqNode{}
Functions ¶
func CheckCipherMethod ¶
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.
Types ¶
type CachedUDPConn ¶
type CachedUDPConn struct { UDP // contains filtered or unexported fields }
func NewCachedUDPConn ¶
func NewCachedUDPConn(cn UDP) *CachedUDPConn
func (*CachedUDPConn) Check ¶
func (c *CachedUDPConn) Check()
func (*CachedUDPConn) Close ¶
func (c *CachedUDPConn) Close() error
func (*CachedUDPConn) Refresh ¶
func (c *CachedUDPConn) Refresh() bool
func (*CachedUDPConn) SetTimer ¶
func (c *CachedUDPConn) SetTimer(index string)
type Cipher ¶
type Cipher struct {
// contains filtered or unexported fields
}
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 ¶
type LeakyBuf ¶
type LeakyBuf struct {
// contains filtered or unexported fields
}
func NewLeakyBuf ¶
NewLeakyBuf creates a leaky buffer which can hold at most n buffer, each with bufSize bytes.
type UDP ¶
type UDP interface { ReadFromUDP(b []byte) (n int, src *net.UDPAddr, err error) Read(b []byte) (n int, err error) WriteToUDP(b []byte, src *net.UDPAddr) (n int, err error) Write(b []byte) (n int, err error) Close() error SetWriteDeadline(t time.Time) error SetReadDeadline(t time.Time) error LocalAddr() net.Addr RemoteAddr() net.Addr ReadFrom(b []byte) (int, net.Addr, error) }
UDP is a udp relay interface
type UDPConn ¶
UDPConn maintain a udp connection list
func (*UDPConn) ReadAndHandleUDPReq ¶
func (c *UDPConn) ReadAndHandleUDPReq()
func (*UDPConn) ReadFromUDP ¶
n is the size of the payload
Click to show internal directories.
Click to hide internal directories.