Documentation ¶
Index ¶
- Constants
- func ChangePacket(ip4 *layers.IPv4, tcp *layers.TCP) []byte
- func GetExtensionBlock(data []byte) ([]byte, error)
- func GetSNBlock(data []byte) ([]byte, error)
- func GetSNIBlock(data []byte) ([]byte, error)
- func ParseHost(data []byte) string
- func PrintFlow(pre string, ip4 *layers.IPv4, tcp *layers.TCP)
- func ProtectConn(conn syscall.Conn) error
- func WrapIPPacketForUdp(srcIp, DstIp net.IP, srcPort, dstPort int, payload []byte) []byte
- type ByPassIPs
- type DnsProxy
- type QueryState
- type Session
- type Tun2Pipe
- type TunConfig
- type UdpProxy
- type UdpSession
Constants ¶
View Source
const ( SysDialTimeOut = time.Second * 2 UDPSessionTimeOut = time.Second * 80 InnerPivotPort = 51414 //TODO:: this port should be refactored )
View Source
const TLSHeaderLength = 5
Variables ¶
This section is empty.
Functions ¶
func GetExtensionBlock ¶
func GetSNBlock ¶
func GetSNIBlock ¶
func ProtectConn ¶
Types ¶
type ByPassIPs ¶
type ByPassIPs struct { Masks map[string]net.IPMask IP map[string]struct{} sync.RWMutex // contains filtered or unexported fields }
func ByPassInst ¶
func ByPassInst() *ByPassIPs
type DnsProxy ¶
type DnsProxy struct { sync.RWMutex VpnWriteBack io.WriteCloser // contains filtered or unexported fields }
func NewDnsCache ¶
func (*DnsProxy) DnsWaitResponse ¶
func (c *DnsProxy) DnsWaitResponse()
func (*DnsProxy) Get ¶
func (c *DnsProxy) Get(id uint16) *QueryState
func (*DnsProxy) Pop ¶
func (c *DnsProxy) Pop(id uint16) *QueryState
func (*DnsProxy) Put ¶
func (c *DnsProxy) Put(qs *QueryState)
type QueryState ¶
type Session ¶
type Tun2Pipe ¶
type Tun2Pipe struct { sync.RWMutex SessionCache map[int]*Session // contains filtered or unexported fields }
func (*Tun2Pipe) InputPacket ¶
func (*Tun2Pipe) ProcessTcpPacket ¶
func (*Tun2Pipe) ProxyClose ¶
type UdpProxy ¶
type UdpProxy struct { sync.RWMutex Done chan error NatSession map[int]*UdpSession }
func NewUdpProxy ¶
func NewUdpProxy() *UdpProxy
func (*UdpProxy) ExpireOldSession ¶
func (up *UdpProxy) ExpireOldSession()
type UdpSession ¶
type UdpSession struct { sync.RWMutex *net.UDPConn UTime time.Time SrcIP net.IP SrcPort int ID string }
TODO::to make sure this is usable
func (*UdpSession) IsExpire ¶
func (s *UdpSession) IsExpire() bool
func (*UdpSession) UpdateTime ¶
func (s *UdpSession) UpdateTime()
func (*UdpSession) WaitingIn ¶
func (s *UdpSession) WaitingIn()
Source Files ¶
Click to show internal directories.
Click to hide internal directories.