Skip to content

Commit

Permalink
Merge pull request #4 from oven/add-proxy
Browse files Browse the repository at this point in the history
Add command line parameter for http proxy
  • Loading branch information
gm-vm committed Aug 2, 2022
2 parents 1194591 + f9f3469 commit eff1daf
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,29 @@ QT_LOGGING_RULES="*=false;webview=true" QTWEBENGINE_CHROMIUM_FLAGS="--enable-log
# If you use the Electron variant
openfortivpn-webview --enable-logging --log-level=3 vpn-gateway
```

## Proxy servers

If you have to use an http proxy to access the vpn gateway or the SAML id
provider, you can pass the `--proxy-server` option to Chromium.

Note that when using the Electron variant, all command line options are
also passed along to Chromium.

```sh
# If you use the Qt variant
QTWEBENGINE_CHROMIUM_FLAGS="--proxy-server=proxy.example.com:8080" openfortivpn-webview vpn-gateway

# If you use the Electron variant
openfortivpn-webview vpn-gateway --proxy-server=proxy.example.com:8080
```

## Passing command line options when using `npm start`

If you use `npm start` to start the Electron variant, you need to separate
the command line options to the application from the command line options
to npm using `--`, like this:

```sh
npm start myvpnhost -- --proxy-server=proxy.example.com:8080
```
4 changes: 4 additions & 0 deletions openfortivpn-webview-electron/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ const parser = yargs(hideBin(process.argv))
.option('keep-open', {
describe: 'Do not close the browser automatically.',
})
.option('proxy-server', {
describe: 'HTTP Proxy in the format hostname:port.',
type: "string",
})
.help();

const argv = parser.parse();
Expand Down

0 comments on commit eff1daf

Please sign in to comment.