Documentation ¶
Index ¶
- type Conn
- func (c *Conn) Client() *net.UDPAddr
- func (c *Conn) Conn() *net.UDPConn
- func (c *Conn) NextUpstream() *net.UDPAddr
- func (c *Conn) Proxy() *net.UDPAddr
- func (c *Conn) Read() ([]byte, error)
- func (c *Conn) RunForward(conn *net.UDPConn) error
- func (c *Conn) SetNextUpstream(upstream *net.UDPAddr)
- func (c *Conn) Stop() error
- func (c *Conn) Upstream() *net.UDPAddr
- func (c *Conn) Write(data []byte) error
- type HandlerFunc
- type HandlersChain
- type Mux
- func (mux *Mux) Connections() []*Conn
- func (mux *Mux) FindConnectionByClient(client *net.UDPAddr) *Conn
- func (mux *Mux) OnGetChallenge(handlers ...HandlerFunc)
- func (mux *Mux) Run(address string) error
- func (mux *Mux) SetDefaultUpstream(upstream *net.UDPAddr)
- func (mux *Mux) SetLogger(logger *log.Logger)
- func (mux *Mux) SetTimeout(timeout time.Duration)
- func (mux *Mux) SetWorkers(n int)
- func (mux *Mux) Stop()
- type Reader
- func (rd *Reader) Peek(n int) ([]byte, error)
- func (rd *Reader) PeekByte() (byte, error)
- func (rd *Reader) PeekUint16() (uint16, error)
- func (rd *Reader) PeekUint32() (uint32, error)
- func (rd *Reader) Read(p []byte) (n int, err error)
- func (rd *Reader) ReadByte() (byte, error)
- func (rd *Reader) ReadBytes(delim byte) ([]byte, error)
- func (rd *Reader) ReadLine() (line []byte, isPrefix bool, err error)
- func (rd *Reader) ReadRune() (r rune, size int, err error)
- func (rd *Reader) ReadSlice(delim byte) (line []byte, err error)
- func (rd *Reader) ReadString(delim byte) (string, error)
- func (rd *Reader) ReadUint16() (uint16, error)
- func (rd *Reader) ReadUint32() (uint32, error)
- func (rd *Reader) Size() int
- func (rd *Reader) Unmunge2(seq uint32)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
func (*Conn) NextUpstream ¶
func (*Conn) SetNextUpstream ¶
type HandlerFunc ¶
type HandlerFunc func(*Conn)
type HandlersChain ¶
type HandlersChain []HandlerFunc
type Mux ¶
type Mux struct {
// contains filtered or unexported fields
}
func (*Mux) Connections ¶
func (*Mux) FindConnectionByClient ¶
func (*Mux) OnGetChallenge ¶
func (mux *Mux) OnGetChallenge(handlers ...HandlerFunc)
func (*Mux) SetDefaultUpstream ¶
func (*Mux) SetTimeout ¶
func (*Mux) SetWorkers ¶
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
a wrapper of buffered IO reader
func (*Reader) PeekUint16 ¶
func (*Reader) PeekUint32 ¶
func (*Reader) ReadUint16 ¶
func (*Reader) ReadUint32 ¶
Click to show internal directories.
Click to hide internal directories.