1
0
Fork 0

Introduce Request struct

Encapsulates state of the incoming request
logger
ap4y 2016-01-11 20:21:34 +13:00
parent 00354d696e
commit 8a2ebe32dc
1 changed files with 17 additions and 0 deletions

View File

@ -47,6 +47,23 @@ type AddrSpec struct {
Port int
}
// A Request represents request received by a server
type Request struct {
// Protocol version
Version uint8
// Requested command
Command uint8
// AuthContext provided during negotiation
AuthContext *AuthContext
// AddrSpec of the the network that sent the request
RemoteAddr *AddrSpec
// AddrSpec of the desired destination
DestAddr *AddrSpec
// AddrSpec of the actual destination (might be affected by rewrite)
realDestAddr *AddrSpec
bufConn io.Reader
}
type conn interface {
Write([]byte) (int, error)
RemoteAddr() net.Addr