mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-23 17:08:44 -06:00
Fix proxy handling in WAStartupService preventing instance to be created
This commit is contained in:
parent
1e9b3a1e42
commit
82e111f1be
@ -1384,6 +1384,7 @@ export class WAStartupService {
|
|||||||
this.logger.info('Proxy enabled: ' + this.localProxy.proxy);
|
this.logger.info('Proxy enabled: ' + this.localProxy.proxy);
|
||||||
|
|
||||||
if (this.localProxy.proxy.host.includes('proxyscrape')) {
|
if (this.localProxy.proxy.host.includes('proxyscrape')) {
|
||||||
|
try {
|
||||||
const response = await axios.get(this.localProxy.proxy.host);
|
const response = await axios.get(this.localProxy.proxy.host);
|
||||||
const text = response.data;
|
const text = response.data;
|
||||||
const proxyUrls = text.split('\r\n');
|
const proxyUrls = text.split('\r\n');
|
||||||
@ -1392,6 +1393,9 @@ export class WAStartupService {
|
|||||||
options = {
|
options = {
|
||||||
agent: new ProxyAgent(proxyUrl as any),
|
agent: new ProxyAgent(proxyUrl as any),
|
||||||
};
|
};
|
||||||
|
} catch (error) {
|
||||||
|
this.localProxy.enabled = false;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
let proxyUri =
|
let proxyUri =
|
||||||
this.localProxy.proxy.protocol + '://' + this.localProxy.proxy.host + ':' + this.localProxy.proxy.port;
|
this.localProxy.proxy.protocol + '://' + this.localProxy.proxy.host + ':' + this.localProxy.proxy.port;
|
||||||
|
Loading…
Reference in New Issue
Block a user