opennord

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2022 License: MIT Imports: 9 Imported by: 0

README

OpenNord Build Workflow

A Go library for interacting with the Linux nordvpn daemon.

OpenNord communicates directly with the NordVPN Linux daemon via gRPC.

Documentation is available here.

Reverse engineering write-up is available here

Contributing

If you run into any issues or see something that you would like to improve, please feel free to create an issue or raise a pull request.

License

This library is licensed under the MIT license.

Documentation

Index

Constants

View Source
const (
	SocketPath     = "/run/nordvpn/nordvpnd.sock"
	SocketAddress  = "unix://" + SocketPath
	RequestTimeout = 5 * time.Second

	ErrOk              = 1000
	StatusOk           = 1000
	StatusConnecting   = 1001
	StatusConnected    = 1002
	StatusGenericError = 2000
	StatusAlreadyRated = 3019
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is the public stub for of communicating with the NordVPN daemon.

func NewOpenNordClient

func NewOpenNordClient() (*Client, error)

NewOpenNordClient creates a client for interacting with the NordVPN daemon.

func (Client) AccountInfo

func (c Client) AccountInfo() (*pb.AccountResponse, error)

AccountInfo calls the AccountInfo RPC and returns an AccountResponse.

func (Client) Cities

func (c Client) Cities(country string) (*pb.CitiesResponse, error)

Cities calls the Cities RPC and returns a CitiesResponse.

func (Client) Connect

func (c Client) Connect(req *pb.ConnectRequest) (pb.Daemon_ConnectClient, error)

Connect calls the Connect RPC and returns a stream of ConnectResponse.

func (Client) Countries

func (c Client) Countries() (*pb.CountriesResponse, error)

Countries calls the Countries RPC and returns a CountriesResponse.

func (Client) Disconnect

func (c Client) Disconnect() error

Disconnect calls the Disconnect RPC and terminates the current VPN session.

func (Client) FrontendCountries

func (c Client) FrontendCountries() (*pb.FrontendCountriesResponse, error)

FrontendCountries calls the FrontendCountries RPC and returns a CountriesResponse.

func (Client) Groups

func (c Client) Groups(req *pb.GroupsRequest) (*pb.GroupsResponse, error)

Groups calls the Groups RPC and returns a GroupsResponse.

func (Client) IsLoggedIn

func (c Client) IsLoggedIn() (*pb.IsLoggedInResponse, error)

IsLoggedIn calls the IsLoggedIn RPC and returns a IsLoggedInResponse.

func (Client) Login

func (c Client) Login(req *pb.LoginRequest) error

Login calls the Login RPC.

func (Client) LoginOAuth2

func (c Client) LoginOAuth2() (*pb.LoginOAuth2Response, error)

LoginOAuth2 calls the LoginOAuth2 RPC.

func (Client) Logout

func (c Client) Logout() error

Logout calls the Logout RPC.

func (Client) Ping

func (c Client) Ping() error

Ping checks that the daemon is alive via the Ping RPC. If the value returned is nil, the ping succeeded.

func (Client) Plans

func (c Client) Plans() (*pb.PlansResponse, error)

Plans calls the Plans RPC.

func (Client) RateConnection

func (c Client) RateConnection(req *pb.RateConnectionRequest) error

RateConnection calls the RateConnection RPC.

func (Client) SetAutoConnect

func (c Client) SetAutoConnect(req *pb.SetAutoConnectRequest) (*pb.Payload, error)

SetAutoConnect calls the SetAutoConnect RPC.

func (Client) SetCyberSec

func (c Client) SetCyberSec(enabled bool) error

SetCyberSec calls the SetCyberSec RPC.

func (Client) SetDefaults

func (c Client) SetDefaults() error

SetDefaults calls the SetDefaults RPC.

func (Client) SetDns

func (c Client) SetDns(req *pb.SetDNSRequest) error

SetDns calls the SetDns RPC.

func (Client) SetFirewall

func (c Client) SetFirewall(enabled bool) error

SetFirewall calls the SetFirewall RPC.

func (Client) SetIpv6

func (c Client) SetIpv6(enabled bool) error

SetIpv6 calls the SetIPv6 RPC.

func (Client) SetKillSwitch

func (c Client) SetKillSwitch(enabled bool) error

SetKillSwitch calls the SetKilLSwitch RPC.

func (Client) SetNotify

func (c Client) SetNotify(enabled bool) error

SetNotify calls the SetNotify RPC.

func (Client) SetObfuscate

func (c Client) SetObfuscate(enabled bool) error

SetObfuscate calls the SetObfuscate RPC.

func (Client) SetProtocol

func (c Client) SetProtocol(protocol pb.ProtocolEnum) error

SetProtocol calls the SetProtocol RPC.

func (Client) SetTechnology

func (c Client) SetTechnology(technology pb.TechnologyEnum) error

SetTechnology calls the SetTechnology RPC.

func (Client) SetWhitelist

func (c Client) SetWhitelist(req *pb.SetWhitelistRequest) error

SetWhitelist calls the SetWhitelist RPC.

func (Client) Settings

func (c Client) Settings() (*pb.SettingsResponse, error)

Settings calls the Settings RPC.

func (Client) SettingsProtocols

func (c Client) SettingsProtocols() (*pb.ProtocolsResponse, error)

SettingsProtocols calls the SettingsProtocols RPC.

func (Client) SettingsTechnologies

func (c Client) SettingsTechnologies() (*pb.TechnologyResponse, error)

SettingsTechnologies calls the SettingsTechnologies RPC.

func (Client) Status

func (c Client) Status() (*pb.StatusResponse, error)

Status calls the Status RPC and returns a StatusResponse.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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