vpn

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const USTBVpnHost = "n.ustb.edu.cn"
View Source
const USTBVpnHttpScheme = "http"
View Source
const USTBVpnHttpsScheme = "https"
View Source
const USTBVpnWSSScheme = "wss"
View Source
const USTBVpnWSScheme = "ws"

Variables

This section is empty.

Functions

This section is empty.

Types

type AesEncrypt

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

func (*AesEncrypt) Encrypt

func (encrypt *AesEncrypt) Encrypt(strMesg string) ([]byte, error)

type AutoLogin

type AutoLogin struct {
	Host        string
	ForceLogout bool
	SSLEnabled  bool // the vpn server supports https
	// contains filtered or unexported fields
}

func (*AutoLogin) LoginAddr

func (al *AutoLogin) LoginAddr(ssl bool) string

func (*AutoLogin) LogoutAddr

func (al *AutoLogin) LogoutAddr(ssl bool) string

func (*AutoLogin) NewHttpClient added in v0.6.0

func (al *AutoLogin) NewHttpClient(force bool, checkRedirect func(req *http.Request, via []*http.Request) error) *http.Client

create http request client with SSLEnabled and skipTLSVerify as config checkRedirect will be passed into http.Client as CheckRedirect func if it is specified. If force is true, it will enable "InsecureSkipVerify" forcely even if current connection is under http (may be redirected to https)

func (*AutoLogin) TestAddr

func (al *AutoLogin) TestAddr(ssl bool) string

type AutoLoginInterface

type AutoLoginInterface interface {
	TestAddr() string
	LoginAddr() string
	LogoutAddr() string
}

type UstbVpn

type UstbVpn struct {
	Enable      bool
	Username    string
	Password    string
	TargetVpn   string
	HostEncrypt bool
	ForceLogout bool
	ConnOptions plugin.Options // normal connection options
}

func NewUstbVpnCli added in v0.5.0

func NewUstbVpnCli() *UstbVpn

create a UstbVpn instance, and add necessary command options to client sub-command.

func (*UstbVpn) BeforeRequest

func (v *UstbVpn) BeforeRequest(hc *http.Client, transport *http.Transport, url *url.URL, header *http.Header) error

implementation of interface RequestPlugin

func (*UstbVpn) OnOptionSet added in v0.6.0

func (v *UstbVpn) OnOptionSet(options client.Options) error

implementation of interface OptionPlugin

Jump to

Keyboard shortcuts

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