mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-12-09 01:49:37 -06:00
lint
This commit is contained in:
parent
31a6f2d92e
commit
179af3f41c
@ -1,8 +1,7 @@
|
|||||||
|
import { ProxyAgent } from 'undici';
|
||||||
import { HttpsProxyAgent } from 'https-proxy-agent';
|
import { HttpsProxyAgent } from 'https-proxy-agent';
|
||||||
import { SocksProxyAgent } from 'socks-proxy-agent';
|
import { SocksProxyAgent } from 'socks-proxy-agent';
|
||||||
|
|
||||||
import { ProxyAgent } from 'undici'
|
|
||||||
|
|
||||||
type Proxy = {
|
type Proxy = {
|
||||||
host: string;
|
host: string;
|
||||||
password?: string;
|
password?: string;
|
||||||
@ -47,7 +46,7 @@ export function makeProxyAgent(proxy: Proxy | string): HttpsProxyAgent<string> |
|
|||||||
return selectProxyAgent(proxyUrl);
|
return selectProxyAgent(proxyUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function makeProxyAgentUndici(proxy: Proxy | string): ProxyAgent|SocksProxyAgent {
|
export function makeProxyAgentUndici(proxy: Proxy | string): ProxyAgent | SocksProxyAgent {
|
||||||
let proxyUrl: string;
|
let proxyUrl: string;
|
||||||
let protocol: string;
|
let protocol: string;
|
||||||
|
|
||||||
@ -65,8 +64,8 @@ export function makeProxyAgentUndici(proxy: Proxy | string): ProxyAgent|SocksPro
|
|||||||
|
|
||||||
const auth = username && password ? `${username}:${password}@` : '';
|
const auth = username && password ? `${username}:${password}@` : '';
|
||||||
proxyUrl = `${protocol}://${auth}${host}:${port}`;
|
proxyUrl = `${protocol}://${auth}${host}:${port}`;
|
||||||
}
|
};
|
||||||
;
|
|
||||||
const PROXY_HTTP_PROTOCOL = 'http';
|
const PROXY_HTTP_PROTOCOL = 'http';
|
||||||
const PROXY_HTTPS_PROTOCOL = 'https';
|
const PROXY_HTTPS_PROTOCOL = 'https';
|
||||||
const PROXY_SOCKS4_PROTOCOL = 'socks4';
|
const PROXY_SOCKS4_PROTOCOL = 'socks4';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user