mirror of
https://github.com/davegallant/vpngate.git
synced 2025-08-06 00:33:40 +00:00
Add support and docs for Windows
This commit is contained in:
@@ -13,6 +13,7 @@ builds:
|
||||
goos:
|
||||
- linux
|
||||
- darwin
|
||||
- windows
|
||||
goarch:
|
||||
- amd64
|
||||
- arm
|
||||
|
15
README.md
15
README.md
@@ -14,22 +14,27 @@ curl ipinfo.io
|
||||
|
||||
## Requirements
|
||||
|
||||
- [openvpn](https://github.com/OpenVPN/openvpn)
|
||||
- macOS or Linux
|
||||
- OpenVPN <= 2.5 (configurations on vpngate.net do not seem work on OpenVPN 2.6+)
|
||||
- macOS, Linux, or Windows
|
||||
|
||||
## Install
|
||||
|
||||
The simplest method of installation is using homebrew. You can also build from source.
|
||||
You can install vpngate in a few different ways, and differs slightly depending on your OS.
|
||||
|
||||
### from homebrew
|
||||
### Homebrew
|
||||
|
||||
vpngate can be installed with [homebrew](https://brew.sh/) (ensure that xcode is installed before installing homebrew by running `xcode-select --install`).
|
||||
|
||||
```shell
|
||||
|
||||
brew install openvpn davegallant/public/vpngate
|
||||
```
|
||||
|
||||
## Windows
|
||||
|
||||
On Windows, install OpenVPN 2.5.x from the [official website](https://openvpn.net/community-downloads/).
|
||||
|
||||
You must run in the terminal (command prompt) as Administrator in order to be able to run the relevant OpenVPN commands.
|
||||
|
||||
### from source
|
||||
|
||||
Ensure that [go](https://golang.org/doc/install) is installed.
|
||||
|
@@ -2,6 +2,7 @@ package vpn
|
||||
|
||||
import (
|
||||
"os"
|
||||
"runtime"
|
||||
|
||||
"github.com/davegallant/vpngate/pkg/exec"
|
||||
"github.com/juju/errors"
|
||||
@@ -28,6 +29,10 @@ func Connect(configPath string) error {
|
||||
}
|
||||
}()
|
||||
|
||||
_, err = exec.Run("openvpn", ".", "--verb", "4", "--log", tmpLogFile.Name(), "--config", configPath)
|
||||
executable := "openvpn"
|
||||
if runtime.GOOS == "windows" {
|
||||
executable = "C:\\Program Files\\OpenVPN\\bin\\openvpn.exe"
|
||||
}
|
||||
_, err = exec.Run(executable, ".", "--verb", "4", "--log", tmpLogFile.Name(), "--config", configPath)
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user