tunnel

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2023 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EndpointAddr = "gost.plus"
	ServerName   = "tunnel.gost.plus"
	ServerAddr   = ServerName + ":443"
)
View Source
const (
	FileTunnel = "file"
	HTTPTunnel = "http"
	TCPTunnel  = "tcp"
	UDPTunnel  = "udp"
)

Variables

View Source
var (
	ErrTunnelClosed = errors.New("tunnel closed")
)

Functions

func Add added in v0.2.0

func Add(s Tunnel)

func ChainConfig added in v0.2.0

func ChainConfig(id string, name string) *xconfig.ChainConfig

func Count added in v0.2.0

func Count() int

func Delete added in v0.2.0

func Delete(id string)

func LoadConfig

func LoadConfig()

func SaveConfig added in v0.2.0

func SaveConfig() error

func Set added in v0.2.0

func Set(s Tunnel)

Types

type Option

type Option func(opts *Options)

func EnableTLSOption

func EnableTLSOption(b bool) Option

func EndpointOption

func EndpointOption(endpoint string) Option

func HostnameOption

func HostnameOption(hostname string) Option

func IDOption

func IDOption(id string) Option

func KeepaliveOption added in v0.2.0

func KeepaliveOption(b bool) Option

func NameOption

func NameOption(name string) Option

func PasswordOption

func PasswordOption(password string) Option

func TTLOption added in v0.2.0

func TTLOption(ttl int) Option

func UsernameOption

func UsernameOption(username string) Option

type Options

type Options struct {
	ID        string
	Name      string
	Endpoint  string
	Hostname  string
	Username  string
	Password  string
	EnableTLS bool
	Keepalive bool
	TTL       int
}

type Tunnel

type Tunnel interface {
	ID() string
	Type() string
	Name() string
	Endpoint() string
	Entrypoint() string
	Options() Options
	Run() error
	Favorite(b bool)
	IsFavorite() bool
	Close() error
	IsClosed() bool
	Err() error
}

func Get added in v0.2.0

func Get(id string) Tunnel

func GetIndex added in v0.2.0

func GetIndex(index int) Tunnel

func NewFileTunnel

func NewFileTunnel(opts ...Option) Tunnel

func NewHTTPTunnel

func NewHTTPTunnel(opts ...Option) Tunnel

func NewTCPTunnel

func NewTCPTunnel(opts ...Option) Tunnel

func NewUDPTunnel

func NewUDPTunnel(opts ...Option) Tunnel

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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