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 ConnProtect
- type DnsProxy
- type QueryState
- type Session
- type Tun2Pipe
- func (t2s *Tun2Pipe) AddSession(portKey int, s *Session)
- func (t2s *Tun2Pipe) Finish()
- func (t2s *Tun2Pipe) GetSession(key int) *Session
- func (t2s *Tun2Pipe) GetTarget(conn net.Conn) string
- func (t2s *Tun2Pipe) InputPacket(buf []byte)
- func (t2s *Tun2Pipe) ProcessTcpPacket(ip4 *layers.IPv4, tcp *layers.TCP)
- func (t2s *Tun2Pipe) Proxying(done chan error)
- func (t2s *Tun2Pipe) RemoveFromSession(keyPort int)
- func (t2s *Tun2Pipe) RemoveSession(key int)
- type UdpProxy
- type UdpSession
- type VpnDelegate
Constants ¶
View Source
const ( SysDialTimeOut = time.Second * 2 UDPSessionTimeOut = time.Second * 80 MTU = math.MaxInt16 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 ¶
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) AddSession ¶
func (*Tun2Pipe) GetSession ¶
func (*Tun2Pipe) InputPacket ¶
func (*Tun2Pipe) ProcessTcpPacket ¶
func (*Tun2Pipe) RemoveFromSession ¶
func (*Tun2Pipe) RemoveSession ¶
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()
type VpnDelegate ¶
type VpnDelegate interface { ByPass(fd int32) bool io.Writer Log(str string) //TODO::variadic function }
var VpnInstance VpnDelegate = nil
Source Files ¶
Click to show internal directories.
Click to hide internal directories.