Documentation
¶
Index ¶
- Constants
- Variables
- func ParseAddress(address string) (a byte, addr []byte, port []byte, err error)
- type Datagram
- type NetRelay
- type Reply
- type Request
- type Service
- func (s *Service) CreateTun(config VpnConfig) (iface *water.Interface)
- func (s *Service) NewVpnService(group string) http.Handler
- func (s *Service) Protocol() p2p.ProtocolSpec
- func (s *Service) RelayHttpDo(w http.ResponseWriter, r *http.Request, addr boson.Address)
- func (s *Service) SetProxyGroup(group string) error
- func (s *Service) SetVpnGroup(group string) error
- func (s *Service) StartProxy(addr, natAddr, group string)
- type UDPExchange
- type VpnConfig
- type VpnService
Constants ¶
View Source
const ( // ATYPIPv4 is ipv4 address type ATYPIPv4 byte = 0x01 // 4 octets // ATYPDomain is domain address type ATYPDomain byte = 0x03 // The first octet of the address field contains the number of octets of name that follow, there is no terminating NUL octet. // ATYPIPv6 is ipv6 address type ATYPIPv6 byte = 0x04 // 16 octets )
Variables ¶
View Source
var ( ErrVersion = errors.New("invalid Version") ErrBadRequest = errors.New("bad Request") )
Functions ¶
Types ¶
type Datagram ¶ added in v1.4.1
type Datagram struct {
Rsv []byte // 0x00 0x00
Frag byte
Atyp byte
DstAddr []byte
DstPort []byte // 2 bytes
Data []byte
}
Datagram is the UDP packet
func NewDatagram ¶ added in v1.4.1
type Reply ¶ added in v1.4.1
type Reply struct {
Ver byte
Rep byte
Rsv byte // 0x00
Atyp byte
// CONNECT socks server's address which used to connect to dst addr
// BIND ...
// UDP socks server's address which used to connect to dst addr
BndAddr []byte
// CONNECT socks server's port which used to connect to dst addr
// BIND ...
// UDP socks server's port which used to connect to dst addr
BndPort []byte // 2 bytes
}
Reply is the reply packet
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) NewVpnService ¶ added in v1.4.1
func (*Service) Protocol ¶
func (s *Service) Protocol() p2p.ProtocolSpec
func (*Service) RelayHttpDo ¶
func (*Service) SetProxyGroup ¶ added in v1.4.1
func (*Service) SetVpnGroup ¶ added in v1.4.1
func (*Service) StartProxy ¶ added in v1.4.1
type UDPExchange ¶ added in v1.4.1
UDPExchange used to store client address and remote connection
type VpnService ¶ added in v1.4.1
type VpnService struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.