bootstrap package - 0xacab.org/leap/bitmask-core/pkg/bootstrap - Go Packages
Documentation ¶ Index ¶ type API func NewAPI(cfg *Config) (*API, error) func (api *API) DoGeolocationLookup() error func (api *API) GetAllBridges(p *BridgeParams) ([]*models.ModelsBridge, error) func (api *API) GetGateways(p *GatewayParams) ([]*models.ModelsGateway, error) func (api *API) GetOpenVPNCert() (string, error) func (api *API) GetProvider() (*models.ModelsProvider, error) func (api *API) GetService() (*models.ModelsEIPService, error) func (api *API) SerializeConfig(params *GatewayParams) (string, error) type BridgeParams type Config func NewConfig() *Config func NewConfigFromURL(url string) (*Config, error) type GatewayParams 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.
Source Files ¶ doh.go init.go serialize.go utils.go Click to show internal directories. Click to hide internal directories. go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic. Learn more.