mirror of
https://github.com/opelly27/streetmerchant.git
synced 2026-05-20 12:17:37 +00:00
feat: support for proxy server (#352)
Co-authored-by: Adrian Martin <adrian.martin@nbcuni.com>
This commit is contained in:
@@ -133,6 +133,11 @@ const page = {
|
||||
width: 1920
|
||||
};
|
||||
|
||||
const proxy = {
|
||||
address: envOrString(process.env.PROXY_ADDRESS, ''),
|
||||
port: envOrNumber(process.env.PROXY_PORT, 80)
|
||||
};
|
||||
|
||||
const store = {
|
||||
country: envOrString(process.env.COUNTRY, 'usa'),
|
||||
microCenterLocation: envOrString(process.env.MICROCENTER_LOCATION, 'web'),
|
||||
@@ -148,5 +153,6 @@ export const Config = {
|
||||
notifications,
|
||||
nvidia,
|
||||
page,
|
||||
proxy,
|
||||
store
|
||||
};
|
||||
|
||||
@@ -36,6 +36,11 @@ async function main() {
|
||||
args.push('--disable-setuid-sandbox');
|
||||
}
|
||||
|
||||
// Add the address of the proxy server if defined
|
||||
if (Config.proxy.address) {
|
||||
args.push(`--proxy-server=http://${Config.proxy.address}:${Config.proxy.port}`);
|
||||
}
|
||||
|
||||
const browser = await puppeteer.launch({
|
||||
args,
|
||||
defaultViewport: {
|
||||
|
||||
Reference in New Issue
Block a user