diff --git a/.env-example b/.env-example index d67637a..5f190c6 100644 --- a/.env-example +++ b/.env-example @@ -59,6 +59,7 @@ PHONE_CARRIER="" PHONE_NUMBER="" PLAY_SOUND="" PROXY_ADDRESS="" +PROXY_PROTOCOL="" PROXY_PORT="" PUSHBULLET="" PUSHOVER_TOKEN="" diff --git a/README.md b/README.md index 8442575..02728ad 100644 --- a/README.md +++ b/README.md @@ -98,6 +98,7 @@ environment variables are **optional**._ | `PAGE_SLEEP_MIN` | Minimum sleep time between queries of the same product page | In milliseconds, default: `5000` | | `PAGE_SLEEP_MAX` | Maximum sleep time between queries of the same product page | In milliseconds, default: `10000` | | `PAGE_TIMEOUT` | Navigation Timeout in milliseconds | `0` for infinite, default: `30000` | +| `PROXY_PROTOCOL` | protocol of proxy server, such as `socks5` | default: `http` | | `PROXY_ADDRESS` | IP Address or fqdn of proxy server | | `PROXY_PORT` | TCP Port number on which the proxy is listening for connections | Default: `80` | | `SCREENSHOT` | Capture screenshot of page if a card is found | Default: `true` | diff --git a/src/config.ts b/src/config.ts index b9c1a22..1c87174 100644 --- a/src/config.ts +++ b/src/config.ts @@ -291,7 +291,8 @@ const page = { const proxy = { address: envOrString(process.env.PROXY_ADDRESS), - port: envOrNumber(process.env.PROXY_PORT, 80) + port: envOrNumber(process.env.PROXY_PORT, 80), + protocol: envOrString(process.env.PROXY_PROTOCOL, 'http') }; // Check for deprecated configuration values diff --git a/src/index.ts b/src/index.ts index e0a5011..573f370 100644 --- a/src/index.ts +++ b/src/index.ts @@ -44,7 +44,7 @@ async function main() { // Add the address of the proxy server if defined if (config.proxy.address) { args.push( - `--proxy-server=http://${config.proxy.address}:${config.proxy.port}` + `--proxy-server=${config.proxy.protocol}://${config.proxy.address}:${config.proxy.port}` ); }