[addon] logs current proxy host
This commit is contained in:
parent
ecb578bd8c
commit
d2de1c7086
1 changed files with 3 additions and 1 deletions
|
|
@ -11,7 +11,9 @@ function getRandomUserAgent() {
|
|||
|
||||
function getRandomProxy() {
|
||||
if (PROXY_HOSTS && PROXY_HOSTS.length && PROXY_USERNAME && PROXY_PASSWORD) {
|
||||
return `http://${PROXY_USERNAME}:${PROXY_PASSWORD}@${PROXY_HOSTS[Math.floor(Math.random() * PROXY_HOSTS.length)]}`;
|
||||
const proxyHost = PROXY_HOSTS[Math.floor(Math.random() * PROXY_HOSTS.length)];
|
||||
console.log(`Using ${proxyHost} proxy`);
|
||||
return `http://${PROXY_USERNAME}:${PROXY_PASSWORD}@${proxyHost}`;
|
||||
}
|
||||
console.warn('No proxy configured!');
|
||||
return undefined;
|
||||
|
|
|
|||
Loading…
Reference in a new issue