vpn

package
v0.0.0-...-59e0dc6 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: GPL-3.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	On       = "on"
	Off      = "off"
	Starting = "starting"
	Stopping = "stopping"
	Failed   = "failed"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bitmask

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

func Init

func Init() (*Bitmask, error)

Init the connection to bitmask

func (*Bitmask) CanStartVPN

func (b *Bitmask) CanStartVPN() bool

func (*Bitmask) CanUpgrade

func (b *Bitmask) CanUpgrade() bool

func (*Bitmask) Close

func (b *Bitmask) Close()

Close the connection to bitmask, and does cleanup of temporal files

func (*Bitmask) DoLogin

func (b *Bitmask) DoLogin(username, password string) (bool, error)

func (*Bitmask) GetBestLocation

func (b *Bitmask) GetBestLocation(transport string) string

func (*Bitmask) GetCurrentCountry

func (b *Bitmask) GetCurrentCountry() string

func (*Bitmask) GetCurrentGateway

func (b *Bitmask) GetCurrentGateway() string

func (*Bitmask) GetCurrentLocation

func (b *Bitmask) GetCurrentLocation() string

func (*Bitmask) GetLocationLabels

func (b *Bitmask) GetLocationLabels(transport string) map[string][]string

func (*Bitmask) GetLocationQualityMap

func (b *Bitmask) GetLocationQualityMap(transport string) map[string]float64

func (*Bitmask) GetMotd

func (b *Bitmask) GetMotd() string

func (*Bitmask) GetSnowflakeCh

func (b *Bitmask) GetSnowflakeCh() <-chan *snowflake.StatusEvent

func (*Bitmask) GetStatus

func (b *Bitmask) GetStatus() (string, error)

GetStatus returns the VPN status

func (*Bitmask) GetStatusCh

func (b *Bitmask) GetStatusCh() <-chan string

GetStatusCh returns a channel that will recieve VPN status changes

func (*Bitmask) GetTransport

func (b *Bitmask) GetTransport() string

GetTransport gets the obfuscation transport to use. Only obfs4 available for now.

func (*Bitmask) IsManualLocation

func (b *Bitmask) IsManualLocation() bool

func (*Bitmask) NeedsCredentials

func (b *Bitmask) NeedsCredentials() bool

func (*Bitmask) OffersUDP

func (b *Bitmask) OffersUDP() bool

func (*Bitmask) Reconnect

func (b *Bitmask) Reconnect() error

Reconnect to the VPN

func (*Bitmask) SetProvider

func (b *Bitmask) SetProvider(p string)

func (*Bitmask) SetTransport

func (b *Bitmask) SetTransport(t string) error

SetTransport selects an obfuscation transport to use

func (*Bitmask) StartVPN

func (b *Bitmask) StartVPN(provider string) error

StartVPN for provider

func (*Bitmask) StopVPN

func (b *Bitmask) StopVPN() error

StopVPN or cancel

func (*Bitmask) UseAutomaticGateway

func (b *Bitmask) UseAutomaticGateway()

UseAutomaticGateway sets the gateway to be selected automatically best gateway will be used

func (*Bitmask) UseGateway

func (b *Bitmask) UseGateway(label string)

UseGateway selects a gateway, by label, as the default gateway

func (*Bitmask) UseSnowflake

func (b *Bitmask) UseSnowflake(s bool) error

func (*Bitmask) UseUDP

func (b *Bitmask) UseUDP(udp bool)

func (*Bitmask) VPNCheck

func (b *Bitmask) VPNCheck() (helpers bool, privilege bool, err error)

VPNCheck returns if the helpers are installed and up to date and if polkit is running

func (*Bitmask) Version

func (b *Bitmask) Version() (string, error)

Version gets the bitmask version string

Directories

Path Synopsis
Package demux implements low-level demultiplexing of the stream of messages sent from OpenVPN on the management channel.
Package demux implements low-level demultiplexing of the stream of messages sent from OpenVPN on the management channel.

Jump to

Keyboard shortcuts

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