bootstrap

package
v0.0.0-...-70ee566 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2025 License: GPL-3.0 Imports: 25 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

func NewAPI

func NewAPI(cfg *Config) (*API, error)

func (*API) DoGeolocationLookup

func (api *API) DoGeolocationLookup() error

func (*API) GetAllBridges

func (api *API) GetAllBridges(p *BridgeParams) ([]*models.ModelsBridge, error)

func (*API) GetGateways

func (api *API) GetGateways(p *GatewayParams) ([]*models.ModelsGateway, error)

GetGateways returns a list of gateways (it it's enabled by the menshen API). It optionally accepts a GatewayParams object where you can set different filters.

func (*API) GetOpenVPNCert

func (api *API) GetOpenVPNCert() (string, error)

GetOpenVPNCert returns valid OpenVPN client credentials (certificate and private key)

func (*API) GetProvider

func (api *API) GetProvider() (*models.ModelsProvider, error)

func (*API) GetService

func (api *API) GetService() (*models.ModelsEIPService, error)

call menshen endpoint /service and return response locations, openvpn arguments, serial+version, auth

func (*API) SerializeConfig

func (api *API) SerializeConfig(params *GatewayParams) (string, error)

SerializeConfig returns a single string containing a valid OpenVPN configuration file.

type BridgeParams

type BridgeParams struct {
	Location  string
	Port      string
	Transport string
	CC        string
	Type      string
}

type Config

type Config struct {
	// country code used to fetch gateways/bridges.
	CountryCode string
	// Host we will connect to for API operations.
	Host string
	// Port we will connect to for API operations (default 443)
	Port int
	// Use TLS to connect to menshen (default: true)
	UseTLS bool
	// Introducer is an obfsucated introducer to use for all bootstrap operations.
	Introducer string
	// Proxy is a local SOCKS5 proxy for all bootstrap operations.
	Proxy string
	// ResolveWithDoH indicates whether we should use a DoH resolver.
	ResolveWithDoH bool
	// STUNServers is a list of STUN users to be used to get the current ip adress
	// The order is kept. A provider can use a list of public STUN servers, use
	// its self-hosted STUN servers or use public STUN servers as a fallback here.
	// A STUN server should be in the format ip/host:port
	STUNServers []string
	// The CountryCodeLookupURL returns a country code for a given ip address.
	CountryCodeLookupURL string
}

func NewConfig

func NewConfig() *Config

func NewConfigFromURL

func NewConfigFromURL(url string) (*Config, error)

type GatewayParams

type GatewayParams struct {
	Location  string
	Port      string
	Transport string
	CC        string
}

GatewayParams contains the fields that can be used to filter the listing of available gateways.

Jump to

Keyboard shortcuts

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