mirror of
https://github.com/opelly27/streetmerchant.git
synced 2026-05-20 07:37:39 +00:00
feat(proxy): socks5 support (#933)
This commit is contained in:
@@ -59,6 +59,7 @@ PHONE_CARRIER=""
|
|||||||
PHONE_NUMBER=""
|
PHONE_NUMBER=""
|
||||||
PLAY_SOUND=""
|
PLAY_SOUND=""
|
||||||
PROXY_ADDRESS=""
|
PROXY_ADDRESS=""
|
||||||
|
PROXY_PROTOCOL=""
|
||||||
PROXY_PORT=""
|
PROXY_PORT=""
|
||||||
PUSHBULLET=""
|
PUSHBULLET=""
|
||||||
PUSHOVER_TOKEN=""
|
PUSHOVER_TOKEN=""
|
||||||
|
|||||||
@@ -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_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_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` |
|
| `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_ADDRESS` | IP Address or fqdn of proxy server |
|
||||||
| `PROXY_PORT` | TCP Port number on which the proxy is listening for connections | Default: `80` |
|
| `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` |
|
| `SCREENSHOT` | Capture screenshot of page if a card is found | Default: `true` |
|
||||||
|
|||||||
+2
-1
@@ -291,7 +291,8 @@ const page = {
|
|||||||
|
|
||||||
const proxy = {
|
const proxy = {
|
||||||
address: envOrString(process.env.PROXY_ADDRESS),
|
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
|
// Check for deprecated configuration values
|
||||||
|
|||||||
+1
-1
@@ -44,7 +44,7 @@ async function main() {
|
|||||||
// Add the address of the proxy server if defined
|
// Add the address of the proxy server if defined
|
||||||
if (config.proxy.address) {
|
if (config.proxy.address) {
|
||||||
args.push(
|
args.push(
|
||||||
`--proxy-server=http://${config.proxy.address}:${config.proxy.port}`
|
`--proxy-server=${config.proxy.protocol}://${config.proxy.address}:${config.proxy.port}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user