openvpn

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct{ Config Config }

func NewClient

func NewClient(config Config) *Client

func (*Client) Start

func (c *Client) Start(ctx context.Context) (*govpn.Session, error)

type Config

type Config struct {
	Remote             string
	Remotes            []Remote
	Port               int
	Protocol           string
	CA                 []byte
	Cert               []byte
	Key                []byte
	PeerFingerprints   [][]byte
	VerifyX509Name     string
	VerifyX509Type     string
	RemoteCertTLS      string
	TLSVersionMin      uint16
	TLSVersionMax      uint16
	Cipher             string
	DataCiphers        []string
	DataCipherFallback string
	Auth               string
	TLSAuth            []byte
	TLSCrypt           []byte
	KeyDirection       int
	KeyDirectionSet    bool
	Username           string
	Password           string
	Compression        string
	MTU                int
	Shape              int
	Logger             *log.Logger
}

func ParseConfigFile

func ParseConfigFile(path string) (*Config, error)

ParseConfigFile reads the client-side subset used by this implementation. It supports path-based and inline ca/cert/key directives. Relative paths, including auth-user-pass files, are resolved from the configuration file.

type Remote

type Remote struct {
	Host     string
	Port     int
	Protocol string
}

type Server

type Server struct{ Config ServerConfig }

func NewServer

func NewServer(config ServerConfig) *Server

func (*Server) Start

func (s *Server) Start(ctx context.Context) (*govpn.Session, error)

type ServerConfig

type ServerConfig struct {
	CA                 []byte
	Cert               []byte
	Key                []byte
	TLSVersionMin      uint16
	TLSVersionMax      uint16
	VerifyClientCert   string
	ListenIP           string
	ListenPort         int
	Protocol           string
	Pool               string
	Pool6              string
	DNS                []net.IP
	MTU                int
	Cipher             string
	DataCiphers        []string
	DataCipherFallback string
	Compression        string
	TLSCrypt           []byte
	TLSAuth            []byte
	Auth               string
	KeyDirection       int
	KeyDirectionSet    bool
	Shape              int
	Logger             *log.Logger
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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