Documentation ¶
Overview ¶
Packages tun provides utilities for tun.
tun包提供 创建tun设备的方法,以及监听tun,将数据解析为tcp/udp数据的方法。
tun 工作在第三层 IP层上。
我们基本上抄了 xjasonlyu/tun2socks, 因此把GPL证书放在了本包的文件夹中
本来最好是直接import的,但是目前(22.12.18)tun2socks的最新代码还没有打tag,而老代码又不可用,所以只能先复制过来。
windows中, 需要从 https://www.wintun.net/ 下载 wintun.dll 放到vs可执行文件旁边
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type StackCloser ¶
func (*StackCloser) Close ¶
func (sc *StackCloser) Close() error
type UdpMsgConn ¶
type UdpMsgConn struct { net.PacketConn RealTarget netLayer.Addr // contains filtered or unexported fields }
Wraps net.PacketConn and implements MsgConn
func (*UdpMsgConn) Close ¶
func (mc *UdpMsgConn) Close() error
func (*UdpMsgConn) CloseConnWithRaddr ¶
func (mc *UdpMsgConn) CloseConnWithRaddr(raddr netLayer.Addr) error
func (*UdpMsgConn) Fullcone ¶
func (mc *UdpMsgConn) Fullcone() bool
Directories ¶
Path | Synopsis |
---|---|
iobased
Package iobased provides the implementation of io.ReadWriter based data-link layer endpoints.
|
Package iobased provides the implementation of io.ReadWriter based data-link layer endpoints. |
tun
Package tun provides TUN which implemented device.Device interface.
|
Package tun provides TUN which implemented device.Device interface. |
Click to show internal directories.
Click to hide internal directories.