tyVpnClient

package
v0.0.0-...-f254aa5 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2020 License: MIT Imports: 29 Imported by: 2

Documentation

Index

Constants

View Source
const (
	Disconnected = "Disconnected"
	Connecting   = "Connecting"
	Connected    = "Connected"
	Reconnecting = "Reconnecting"
)

Variables

This section is empty.

Functions

func CmdRun

func CmdRun(req Config)

func Connect

func Connect()

func Disconnect

func Disconnect()

func GetLastError

func GetLastError() string

func GetVpnStatus

func GetVpnStatus() string

func Ping

func Ping(req PingReq) error

TODO relay mode

func Reconnect

func Reconnect()

func SetConfig

func SetConfig(config *Config)

func SetOnChangeCallback

func SetOnChangeCallback(name string, fn func())

func SetOnChangeCallbackFilterSame

func SetOnChangeCallbackFilterSame(name string, fn func(vpnStatus string, lastErr string))

func Toggle

func Toggle()

Types

type Client

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

type Config

type Config struct {
	ServerIp   string `json:",omitempty"`
	ServerTKey string `json:",omitempty"`

	IsRelay            bool   `json:",omitempty"`
	ExitServerClientId uint64 `json:",omitempty"` //required when IsRelay is true
	ExitServerTKey     string `json:",omitempty"` //required when IsRelay is true

	ServerChk                   string `json:",omitempty"` // if it is "", it will use InsecureSkipVerify
	DisableUsePublicRouteServer bool   `json:",omitempty"`
}

func ParseAndVerifyConfigS

func ParseAndVerifyConfigS(configS string) (config *Config, errMsg string)

type PingReq

type PingReq struct {
	Ip        string
	ServerChk string // if it is "", it will use InsecureSkipVerify
	Count     int
	DebugLog  bool
}

Jump to

Keyboard shortcuts

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