Documentation ¶
Overview ¶
Package extras contains some utilities that are not part of the OpenVPN implementation, but that are useful for practical purposes together with the tunnel.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunMeasurement ¶ added in v0.0.3
RunMeasurement performs a download & upload measurement against a given ndt7 server. It expects a vpn Dialer and a server string (ip:port). If the direct parameter is set to true, the vpn Dialer will not be used and a direct connection will be used instead.
Types ¶
type Pinger ¶
type Pinger struct { Count int Interval time.Duration ID int // contains filtered or unexported fields }
Pinger holds all the needed info to ping a target.
Example ¶
package main import ( "os" "github.com/ainghazal/minivpn/vpn" ) var ( cfg = "data/calyx/config" target = "8.8.8.8" count = 3 ) func main() { opts, err := vpn.ParseConfigFile(cfg) if err != nil { os.Exit(1) } rawDialer := vpn.NewRawDialer(opts) pinger := NewPinger(rawDialer, target, count) pinger.Run() }
Output:
Click to show internal directories.
Click to hide internal directories.