@wiajs/agent
Advanced tools
Comparing version 1.0.12 to 1.0.13
@@ -8,3 +8,3 @@ import http from 'node:http'; | ||
const log = Log({ | ||
env: `wia:agent:${name(__filename)}` | ||
env: `wia:agent:${name(import.meta.url)}` | ||
}); | ||
@@ -66,3 +66,4 @@ /** @typedef {import('stream').Duplex} Duplex */ /** @typedef {import('./tunnel').AgentConnectOpts & {hostname?: string, path?: string, pathname?: string, keepAlive: boolean}} AgentConnectOpts */ /** @typedef {import('./tunnel').Proxy} Proxy */ /** @typedef {http.AgentOptions & https.AgentOptions & {proxy: string|Proxy, proxyOpts?: *, tunnel?: boolean}} AgentOpts */ /** | ||
super(opt); | ||
if (opt.timeout) this.timeout = opt.timeout; // super(opt) 无效 | ||
if (opt.timeout) this.timeout = opt.timeout // super(opt) 无效 | ||
; | ||
this.opt = opt; | ||
@@ -110,3 +111,4 @@ let lookup = false; | ||
} | ||
}, 'addRequest'); // 消除 [Object: null prototype] | ||
}, 'addRequest') // 消除 [Object: null prototype] | ||
; | ||
// 非隧道,转发模式,修改req连接代理 | ||
@@ -137,3 +139,4 @@ if (!_.tunnel) { | ||
const protocol = opts.protocol; | ||
const host = req.getHeader('host') || 'localhost'; // 带端口 | ||
const host = req.getHeader('host') || 'localhost' // 带端口 | ||
; | ||
const base = `${protocol}//${host}`; | ||
@@ -140,0 +143,0 @@ const url = new URL(req.path, base); |
@@ -6,3 +6,3 @@ import http from 'node:http'; | ||
const log = Log({ | ||
env: `wia:agent:${name(__filename)}` | ||
env: `wia:agent:${name(import.meta.url)}` | ||
}); | ||
@@ -30,3 +30,4 @@ /** @typedef {import('stream').Duplex} Duplex */ /** @typedef {import('./tunnel').AgentConnectOpts} AgentConnectOpts */ /** @typedef {import('./tunnel').Proxy} Proxy */ /** @typedef {http.AgentOptions & https.AgentOptions & {proxy: string|Proxy, proxyOpts?: *, tunnel?: boolean}} AgentOpts */ /** | ||
super(opt); | ||
if (opt.timeout) this.timeout = opt.timeout; // super(opt) 无效 | ||
if (opt.timeout) this.timeout = opt.timeout // super(opt) 无效 | ||
; | ||
this.opt = opt; | ||
@@ -33,0 +34,0 @@ let lookup = false; |
@@ -9,3 +9,3 @@ import * as dns from 'node:dns'; | ||
const log = Log({ | ||
env: `wia:agent:${name(__filename)}` | ||
env: `wia:agent:${name(import.meta.url)}` | ||
}); | ||
@@ -12,0 +12,0 @@ /** @typedef {import('stream').Duplex} Duplex */ /** @typedef {{protocol?: string, keepAlive: boolean} & import('net').TcpNetConnectOpts} HttpConnectOpts */ /** @typedef {{servername?:string, protocol?: string, port: number, keepAlive: boolean} & import('tls').ConnectionOptions} HttpsConnectOpts */ /** @typedef {HttpConnectOpts | HttpsConnectOpts} AgentConnectOpts */ /** @typedef {{protocol: string, host: string, port: number, type?: number, username?: string, userId?: string, password?: string}} Proxy */ /** |
{ | ||
"name": "@wiajs/agent", | ||
"description": "http/https/socks/tunnel/transfer's proxy agent", | ||
"version": "1.0.12", | ||
"version": "1.0.13", | ||
"type": "module", | ||
@@ -47,3 +47,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"@wiajs/log": "^4.3.10" | ||
"@wiajs/log": "^4.3.11" | ||
}, | ||
@@ -50,0 +50,0 @@ "devDependencies": {}, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
502093
12909
3
Updated@wiajs/log@^4.3.11