tunnel

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2020 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const CheckConnectTargetIp = "0.0.0.0"
View Source
const CheckConnectTargetPort = 0
View Source
const ConnectionUpperLimit = 0x01
View Source
const ConnectionUpperLimitMessage = "已到达连接上限"
View Source
const Success = 0x00
View Source
const SuccessMessage = "OK"
View Source
const Ver01 = 0x01

Variables

This section is empty.

Functions

func CheckServer

func CheckServer(config *Config) error

CheckServer 检查服务端是否支持隧道协议

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client 隧道的客户端结构体

func NewClient

func NewClient(config *Config) (*Client, error)

NewClient 创建一个客户端

func (*Client) Bind

func (c *Client) Bind(src net.Conn) error

Bind 双向绑定服务端以及请求来源

type Config

type Config struct {
	ServerHostname string // 服务端域名
	ServerPort     int    // 服务端端口号
	ServerUsername string // 验证用户
	ServerPassword string // 用户密码

	TargetType     byte   // 目标类型
	TargetHostOrIp string // 目标host或ip
	TargetPort     int    // 目标端口号

	Verbose bool // 详细模式
}

Config 隧道客户端配置结构体

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server 隧道的服务端结构体

func NewServer

func NewServer(src net.Conn, userConfig *config.UserConfig, verbose bool) (*Server, error)

NewServer 新建一个隧道的服务端

func (*Server) Bind

func (s *Server) Bind() error

Bind 双向绑定客户端以及目标服务器

Jump to

Keyboard shortcuts

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