tun

package
v1.2.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 28, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package tun implements proxy.Server for tun device.

tun Server使用 host 配置作为 tun device name
使用 ip 配置作为 gateway 的ip
使用 extra.tun_selfip 作为 tun向外拨号的ip

tun device name的默认值约定: mac: 系统指派, windows: vs_wintun, linux: vs_tun

Index

Constants

This section is empty.

Variables

View Source
var (
	AddManualRunCmdsListFunc func([]string)
)

Functions

This section is empty.

Types

type Server

type Server struct {
	proxy.Base
	// contains filtered or unexported fields
}

func (*Server) Close

func (s *Server) Close() error

func (*Server) Handshake

func (s *Server) Handshake(underlay net.Conn) (net.Conn, netLayer.MsgConn, netLayer.Addr, error)

func (*Server) Name

func (*Server) Name() string

func (*Server) SelfListen

func (s *Server) SelfListen() (is bool, tcp, udp int)

func (*Server) StartListen

func (s *Server) StartListen(tcpFunc func(netLayer.TCPRequestInfo), udpFunc func(netLayer.UDPRequestInfo)) io.Closer

非阻塞

func (*Server) Stop

func (s *Server) Stop()

type ServerCreator

type ServerCreator struct{ proxy.CreatorCommonStruct }

func (ServerCreator) AfterCommonConfServer

func (ServerCreator) AfterCommonConfServer(ps proxy.Server) (err error)

func (ServerCreator) NewServer

func (ServerCreator) NewServer(lc *proxy.ListenConf) (proxy.Server, error)

func (ServerCreator) URLToListenConf

func (ServerCreator) URLToListenConf(url *url.URL, lc *proxy.ListenConf, format int) (*proxy.ListenConf, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL