Documentation ¶
Index ¶
- func GetOpenVPNVersion(ovpnBinary string) []int
- type ConnectionParams
- type ManagementInterface
- func (i *ManagementInterface) GetRouteAddCommands() []string
- func (i *ManagementInterface) ListenAddress() (ip string, port int, e error)
- func (i *ManagementInterface) SendDisconnect() error
- func (i *ManagementInterface) SetConnectionVerified()
- func (i *ManagementInterface) StopManagementInterface() error
- type OpenVPN
- func (o *OpenVPN) Connect(stateChan chan<- vpn.StateInfo) (retErr error)
- func (o *OpenVPN) DestinationIP() net.IP
- func (o *OpenVPN) Disconnect() error
- func (o *OpenVPN) Init() error
- func (o *OpenVPN) IsPaused() bool
- func (o *OpenVPN) OnRoutingChanged() error
- func (o *OpenVPN) Pause() error
- func (o *OpenVPN) ResetManualDNS() error
- func (o *OpenVPN) Resume() error
- func (o *OpenVPN) SetManualDNS(addr net.IP) error
- func (o *OpenVPN) Type() vpn.Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetOpenVPNVersion ¶
GetOpenVPNVersion trying to get openvpn binary version
Types ¶
type ConnectionParams ¶
type ConnectionParams struct {
// contains filtered or unexported fields
}
ConnectionParams represents OpenVPN connection parameters
func CreateConnectionParams ¶
func CreateConnectionParams( multihopExitSrvID string, tcp bool, hostPort int, hostIP net.IP, proxyType string, proxyAddress net.IP, proxyPort int, proxyUsername string, proxyPassword string) ConnectionParams
CreateConnectionParams creates OpenVPN connection parameters object
func (*ConnectionParams) SetCredentials ¶
func (c *ConnectionParams) SetCredentials(username, password string)
SetCredentials update WG credentials
func (*ConnectionParams) WriteConfigFile ¶
func (c *ConnectionParams) WriteConfigFile( localPort int, filePathToSave string, miAddr string, miPort int, logFile string, obfsproxyPort int, extraParameters string, isCanUseV24Params bool) error
WriteConfigFile saves OpenVPN connection parameters into a config file
type ManagementInterface ¶
type ManagementInterface struct {
// contains filtered or unexported fields
}
ManagementInterface structure
func StartManagementInterface ¶
func StartManagementInterface(miSecret string, username string, password string, stateChan chan<- vpn.StateInfo) (mi *ManagementInterface, err error)
StartManagementInterface - starts TCP interface to communicate with IVPN application (server to listen incoming connections)
func (*ManagementInterface) GetRouteAddCommands ¶
func (i *ManagementInterface) GetRouteAddCommands() []string
GetRouteAddCommands - return all detected route-add command
func (*ManagementInterface) ListenAddress ¶
func (i *ManagementInterface) ListenAddress() (ip string, port int, e error)
ListenAddress returns ip:port of listener
func (*ManagementInterface) SendDisconnect ¶
func (i *ManagementInterface) SendDisconnect() error
SendDisconnect - Send disconnect command to openvpn
func (*ManagementInterface) SetConnectionVerified ¶
func (i *ManagementInterface) SetConnectionVerified()
SetConnectionVerified sets the current MI connection as verified: communication allowed
func (*ManagementInterface) StopManagementInterface ¶
func (i *ManagementInterface) StopManagementInterface() error
StopManagementInterface - Stop management interface manually
type OpenVPN ¶
type OpenVPN struct {
// contains filtered or unexported fields
}
OpenVPN structure represents all data of OpenVPN connection
func NewOpenVpnObject ¶
func NewOpenVpnObject( binaryPath string, configPath string, logFile string, isObfsProxy bool, extraParameters string, connectionParams ConnectionParams) (*OpenVPN, error)
NewOpenVpnObject creates new OpenVPN structure
func (*OpenVPN) DestinationIP ¶
DestinationIP - Get destination IPs (VPN host server or proxy server IP address) This information if required, for example, to allow this address in firewall
func (*OpenVPN) Init ¶
Init performs basic initializations before connection It is useful, for example:
- for WireGuard(Windows) - to ensure that WG service is fully uninstalled
- for OpenVPN(Linux) - to ensure that OpenVPN has correct version
func (*OpenVPN) OnRoutingChanged ¶
func (*OpenVPN) ResetManualDNS ¶
ResetManualDNS restores DNS
func (*OpenVPN) Resume ¶
Resume doing required operation for Resume (restores DNS configuration before Pause)
func (*OpenVPN) SetManualDNS ¶
SetManualDNS changes DNS to manual IP