tcptunnel

package
v0.0.0-...-8bcd692 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// ServerAddr 服务端的地址,必填,如 192.168.1.10:8080
	ServerAddr string

	// LocalAddr 期望对外发布的本地服务的地址,必填,如 127.0.0.1:8090
	LocalAddr string

	// Worker
	Worker int

	// ConnectTimeout 网络连接超时时间,可选
	ConnectTimeout time.Duration

	// Token 加密密码,可选
	Token string
	// contains filtered or unexported fields
}

func (*Client) BindFlags

func (c *Client) BindFlags()

func (*Client) Start

func (c *Client) Start() error

type Server

type Server struct {
	// ListenOut 对外转发的监听地址,必填
	ListenOut string

	// ListenClient 为 Client 准备的监听地址,必填
	ListenClient string

	// Token 加密密码,可选
	Token string

	ClientExpire time.Duration

	Size int
	// contains filtered or unexported fields
}

func (*Server) BindFlags

func (s *Server) BindFlags()

func (*Server) Start

func (s *Server) Start() error

type Tunneler

type Tunneler struct {
	// RemoteRW 和远端 Tunneler client 或者 server 的连接
	RemoteRW func() io.ReadWriteCloser

	// LocalRW 和本地其他 server(待穿透的实际服务),如 nginx 等的连接
	LocalRW func() io.ReadWriteCloser

	Worker int

	Token string
	// contains filtered or unexported fields
}

func (*Tunneler) Start

func (c *Tunneler) Start() error

func (*Tunneler) Stop

func (c *Tunneler) Stop()

Jump to

Keyboard shortcuts

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