@stryke/http 0.8.4 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent.cjs +84 -0
- package/dist/agent.d.ts +36 -0
- package/dist/agent.mjs +2 -0
- package/dist/fetch.cjs +38 -0
- package/dist/fetch.d.ts +19 -0
- package/dist/fetch.mjs +1 -0
- package/dist/format-data-uri.cjs +24 -2
- package/dist/format-data-uri.d.ts +40 -0
- package/dist/format-data-uri.mjs +1 -1
- package/dist/http-proxy.cjs +71 -0
- package/dist/http-proxy.d.ts +39 -0
- package/dist/http-proxy.mjs +3 -0
- package/dist/https-proxy.cjs +88 -0
- package/dist/https-proxy.d.ts +43 -0
- package/dist/https-proxy.mjs +4 -0
- package/dist/index.cjs +52 -8
- package/dist/index.d.ts +6 -2
- package/dist/index.mjs +1 -1
- package/dist/parse-response.cjs +63 -0
- package/dist/parse-response.d.ts +12 -0
- package/dist/parse-response.mjs +4 -0
- package/dist/proxy-agent.cjs +14 -0
- package/dist/proxy-agent.d.ts +5 -0
- package/dist/proxy-agent.mjs +1 -0
- package/package.json +69 -18
- package/dist/cookie.cjs +0 -187
- package/dist/cookie.d.ts +0 -37
- package/dist/cookie.mjs +0 -1
- package/dist/types.cjs +0 -1
- package/dist/types.d.ts +0 -184
- package/dist/types.mjs +0 -0
package/dist/agent.cjs
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Agent = void 0;
|
|
7
|
+
var _typeChecks = require("@stryke/type-checks");
|
|
8
|
+
var u = _interopRequireWildcard(require("node:http"));
|
|
9
|
+
var h = _interopRequireWildcard(require("node:net"));
|
|
10
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
11
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
12
|
+
const n = Symbol("AgentBaseInternalState");
|
|
13
|
+
class Agent extends u.Agent {
|
|
14
|
+
[n];
|
|
15
|
+
options;
|
|
16
|
+
keepAlive;
|
|
17
|
+
constructor(t) {
|
|
18
|
+
super(t), this[n] = {};
|
|
19
|
+
}
|
|
20
|
+
isSecureEndpoint(t) {
|
|
21
|
+
if (t) {
|
|
22
|
+
if ((0, _typeChecks.isBoolean)(t.secureEndpoint)) return t.secureEndpoint;
|
|
23
|
+
if ((0, _typeChecks.isString)(t.protocol)) return t.protocol === "https:";
|
|
24
|
+
}
|
|
25
|
+
const {
|
|
26
|
+
stack: e
|
|
27
|
+
} = new Error(" ");
|
|
28
|
+
return (0, _typeChecks.isString)(e) ? e.split(`
|
|
29
|
+
`).some(s => s.includes("(https.js:") || s.includes("node:https:")) : !1;
|
|
30
|
+
}
|
|
31
|
+
incrementSockets(t) {
|
|
32
|
+
if (this.maxSockets === 1 / 0 && this.maxTotalSockets === 1 / 0) return null;
|
|
33
|
+
this.sockets[t] ??= [];
|
|
34
|
+
const e = new h.Socket({
|
|
35
|
+
writable: !1
|
|
36
|
+
});
|
|
37
|
+
return this.sockets[t].push(e), this.totalSocketCount++, e;
|
|
38
|
+
}
|
|
39
|
+
decrementSockets(t, e) {
|
|
40
|
+
if (!this.sockets[t] || e === null) return;
|
|
41
|
+
const s = this.sockets[t],
|
|
42
|
+
o = s.indexOf(e);
|
|
43
|
+
o !== -1 && (s.splice(o, 1), this.totalSocketCount--, s.length === 0 && delete this.sockets[t]);
|
|
44
|
+
}
|
|
45
|
+
getName(t) {
|
|
46
|
+
return this.isSecureEndpoint(t) ? HttpsAgent.prototype.getName.call(this, t) : super.getName(t);
|
|
47
|
+
}
|
|
48
|
+
createSocket(t, e, s) {
|
|
49
|
+
const o = {
|
|
50
|
+
...e,
|
|
51
|
+
secureEndpoint: this.isSecureEndpoint(e)
|
|
52
|
+
},
|
|
53
|
+
c = this.getName(o),
|
|
54
|
+
i = this.incrementSockets(c);
|
|
55
|
+
Promise.resolve().then(async () => this.connect(t, o)).then(r => {
|
|
56
|
+
if (this.decrementSockets(c, i), r instanceof u.Agent) try {
|
|
57
|
+
return r.addRequest(t, o);
|
|
58
|
+
} catch (l) {
|
|
59
|
+
return s(l);
|
|
60
|
+
}
|
|
61
|
+
this[n].currentSocket = r, super.createSocket(t, e, s);
|
|
62
|
+
}, r => {
|
|
63
|
+
this.decrementSockets(c, i), s(r);
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
createConnection() {
|
|
67
|
+
const t = this[n].currentSocket;
|
|
68
|
+
if (this[n].currentSocket = void 0, !t) throw new Error("No socket was returned in the `connect()` function");
|
|
69
|
+
return t;
|
|
70
|
+
}
|
|
71
|
+
get defaultPort() {
|
|
72
|
+
return this[n].defaultPort ?? (this.protocol === "https:" ? 443 : 80);
|
|
73
|
+
}
|
|
74
|
+
set defaultPort(t) {
|
|
75
|
+
this[n] && (this[n].defaultPort = t);
|
|
76
|
+
}
|
|
77
|
+
get protocol() {
|
|
78
|
+
return this[n].protocol ?? (this.isSecureEndpoint() ? "https:" : "http:");
|
|
79
|
+
}
|
|
80
|
+
set protocol(t) {
|
|
81
|
+
this[n] && (this[n].protocol = t);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
exports.Agent = Agent;
|
package/dist/agent.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as http from "node:http";
|
|
2
|
+
import * as net from "node:net";
|
|
3
|
+
import type { Duplex } from "node:stream";
|
|
4
|
+
import type * as tls from "node:tls";
|
|
5
|
+
interface HttpConnectOpts extends net.TcpNetConnectOpts {
|
|
6
|
+
secureEndpoint: false;
|
|
7
|
+
protocol?: string;
|
|
8
|
+
}
|
|
9
|
+
interface HttpsConnectOpts extends tls.ConnectionOptions {
|
|
10
|
+
secureEndpoint: true;
|
|
11
|
+
protocol?: string;
|
|
12
|
+
port: number;
|
|
13
|
+
}
|
|
14
|
+
export type AgentConnectOpts = HttpConnectOpts | HttpsConnectOpts;
|
|
15
|
+
declare const INTERNAL: unique symbol;
|
|
16
|
+
export declare abstract class Agent extends http.Agent {
|
|
17
|
+
private [INTERNAL];
|
|
18
|
+
options: Partial<net.TcpNetConnectOpts & tls.ConnectionOptions>;
|
|
19
|
+
keepAlive: boolean;
|
|
20
|
+
constructor(opts?: http.AgentOptions);
|
|
21
|
+
abstract connect(req: http.ClientRequest, options: AgentConnectOpts): Promise<Duplex | http.Agent> | Duplex | http.Agent;
|
|
22
|
+
/**
|
|
23
|
+
* Determine whether this is an `http` or `https` request.
|
|
24
|
+
*/
|
|
25
|
+
isSecureEndpoint(options?: AgentConnectOpts): boolean;
|
|
26
|
+
private incrementSockets;
|
|
27
|
+
private decrementSockets;
|
|
28
|
+
getName(options?: AgentConnectOpts): string;
|
|
29
|
+
createSocket(req: http.ClientRequest, options: AgentConnectOpts, cb: (err: Error | null, s?: Duplex) => void): void;
|
|
30
|
+
createConnection(): Duplex;
|
|
31
|
+
get defaultPort(): number;
|
|
32
|
+
set defaultPort(v: number);
|
|
33
|
+
get protocol(): string;
|
|
34
|
+
set protocol(v: string);
|
|
35
|
+
}
|
|
36
|
+
export {};
|
package/dist/agent.mjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{isBoolean as a,isString as p}from"@stryke/type-checks";import*as u from"node:http";import*as h from"node:net";const n=Symbol("AgentBaseInternalState");export class Agent extends u.Agent{[n];options;keepAlive;constructor(t){super(t),this[n]={}}isSecureEndpoint(t){if(t){if(a(t.secureEndpoint))return t.secureEndpoint;if(p(t.protocol))return t.protocol==="https:"}const{stack:e}=new Error(" ");return p(e)?e.split(`
|
|
2
|
+
`).some(s=>s.includes("(https.js:")||s.includes("node:https:")):!1}incrementSockets(t){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[t]??=[];const e=new h.Socket({writable:!1});return this.sockets[t].push(e),this.totalSocketCount++,e}decrementSockets(t,e){if(!this.sockets[t]||e===null)return;const s=this.sockets[t],o=s.indexOf(e);o!==-1&&(s.splice(o,1),this.totalSocketCount--,s.length===0&&delete this.sockets[t])}getName(t){return this.isSecureEndpoint(t)?HttpsAgent.prototype.getName.call(this,t):super.getName(t)}createSocket(t,e,s){const o={...e,secureEndpoint:this.isSecureEndpoint(e)},c=this.getName(o),i=this.incrementSockets(c);Promise.resolve().then(async()=>this.connect(t,o)).then(r=>{if(this.decrementSockets(c,i),r instanceof u.Agent)try{return r.addRequest(t,o)}catch(l){return s(l)}this[n].currentSocket=r,super.createSocket(t,e,s)},r=>{this.decrementSockets(c,i),s(r)})}createConnection(){const t=this[n].currentSocket;if(this[n].currentSocket=void 0,!t)throw new Error("No socket was returned in the `connect()` function");return t}get defaultPort(){return this[n].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(t){this[n]&&(this[n].defaultPort=t)}get protocol(){return this[n].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(t){this[n]&&(this[n].protocol=t)}}
|
package/dist/fetch.cjs
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.$fetch = $fetch;
|
|
7
|
+
exports.fetch = void 0;
|
|
8
|
+
var _nodeBuffer = require("node:buffer");
|
|
9
|
+
var _nodeHttp = _interopRequireDefault(require("node:http"));
|
|
10
|
+
var _nodeHttps = _interopRequireDefault(require("node:https"));
|
|
11
|
+
var _proxyAgent = require("./proxy-agent.cjs");
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
async function $fetch(o, f = {}) {
|
|
14
|
+
return new Promise((c, n) => {
|
|
15
|
+
const {
|
|
16
|
+
protocol: a
|
|
17
|
+
} = new URL(o),
|
|
18
|
+
u = a === "https:" ? _nodeHttps.default : _nodeHttp.default,
|
|
19
|
+
r = f.isDev ? 3e3 : void 0,
|
|
20
|
+
e = u.request(o, {
|
|
21
|
+
agent: (0, _proxyAgent.getProxyAgent)(),
|
|
22
|
+
headers: {
|
|
23
|
+
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36"
|
|
24
|
+
}
|
|
25
|
+
}, t => {
|
|
26
|
+
if (t.statusCode !== 200) {
|
|
27
|
+
n(new Error(`Request failed: ${o} (status: ${t.statusCode})`));
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const s = [];
|
|
31
|
+
t.on("data", m => s.push(_nodeBuffer.Buffer.from(m))), t.on("end", () => c(_nodeBuffer.Buffer.concat(s)));
|
|
32
|
+
});
|
|
33
|
+
r && e.setTimeout(r, () => {
|
|
34
|
+
e.destroy(new Error(`Request timed out after ${r}ms`));
|
|
35
|
+
}), e.on("error", t => n(t)), e.end();
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
const fetch = exports.fetch = $fetch;
|
package/dist/fetch.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Buffer } from "node:buffer";
|
|
2
|
+
export interface FetchRequestOptions {
|
|
3
|
+
isDev?: boolean;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Fetches a resource from a URL.
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* Makes a simple GET request and returns the entire response as a Buffer.
|
|
10
|
+
*
|
|
11
|
+
* Features:
|
|
12
|
+
* - Throws if the response status is not 200.
|
|
13
|
+
* - Applies a 3000 ms timeout when `isDev` is `true`.
|
|
14
|
+
*
|
|
15
|
+
* @param url - The URL to fetch.
|
|
16
|
+
* @returns A promise that resolves to the response body as a Buffer.
|
|
17
|
+
*/
|
|
18
|
+
export declare function $fetch(url: string, options?: FetchRequestOptions): Promise<Buffer>;
|
|
19
|
+
export declare const fetch: typeof $fetch;
|
package/dist/fetch.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Buffer as i}from"node:buffer";import p from"node:http";import h from"node:https";import{getProxyAgent as d}from"./proxy-agent";export async function $fetch(o,f={}){return new Promise((c,n)=>{const{protocol:a}=new URL(o),u=a==="https:"?h:p,r=f.isDev?3e3:void 0,e=u.request(o,{agent:d(),headers:{"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36"}},t=>{if(t.statusCode!==200){n(new Error(`Request failed: ${o} (status: ${t.statusCode})`));return}const s=[];t.on("data",m=>s.push(i.from(m))),t.on("end",()=>c(i.concat(s)))});r&&e.setTimeout(r,()=>{e.destroy(new Error(`Request timed out after ${r}ms`))}),e.on("error",t=>n(t)),e.end()})}export const fetch=$fetch;
|
package/dist/format-data-uri.cjs
CHANGED
|
@@ -3,6 +3,28 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.formatDataURI = void 0;
|
|
7
|
-
const formatDataURI = (
|
|
6
|
+
exports.makeDataUriToBuffer = exports.formatDataURI = void 0;
|
|
7
|
+
const formatDataURI = (a, t) => `data:${t};utf8,${encodeURIComponent(a)}`,
|
|
8
|
+
makeDataUriToBuffer = a => t => {
|
|
9
|
+
if (t = String(t), !/^data:/i.test(t)) throw new Error('`uri` does not appear to be a Data URI (must begin with "data:")');
|
|
10
|
+
t = t.replace(/\r?\n/g, "");
|
|
11
|
+
const s = t.indexOf(",");
|
|
12
|
+
if (s === -1 || s <= 4) throw new Error("malformed data: URI");
|
|
13
|
+
const e = t.substring(5, s).split(";");
|
|
14
|
+
let n = "",
|
|
15
|
+
o = !1;
|
|
16
|
+
const i = e[0] || "text/plain";
|
|
17
|
+
let f = i;
|
|
18
|
+
for (let r = 1; r < e.length; r++) e[r] === "base64" ? o = !0 : e[r] && (f += `;${e[r]}`, e[r]?.indexOf("charset=") === 0 && (n = e[r].substring(8)));
|
|
19
|
+
!e[0] && !n.length && (f += ";charset=US-ASCII", n = "US-ASCII");
|
|
20
|
+
const g = unescape(t.substring(s + 1)),
|
|
21
|
+
c = o ? a.base64ToArrayBuffer(g) : a.stringToBuffer(g);
|
|
22
|
+
return {
|
|
23
|
+
type: i,
|
|
24
|
+
typeFull: f,
|
|
25
|
+
charset: n,
|
|
26
|
+
buffer: c
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
exports.makeDataUriToBuffer = makeDataUriToBuffer;
|
|
8
30
|
exports.formatDataURI = formatDataURI;
|
|
@@ -6,3 +6,43 @@
|
|
|
6
6
|
* @returns The data URI.
|
|
7
7
|
*/
|
|
8
8
|
export declare const formatDataURI: (data: string, mime: string) => string;
|
|
9
|
+
export interface ParsedDataURI {
|
|
10
|
+
type: string;
|
|
11
|
+
typeFull: string;
|
|
12
|
+
charset: string;
|
|
13
|
+
buffer: ArrayBuffer;
|
|
14
|
+
}
|
|
15
|
+
export interface BufferConversionsInterface {
|
|
16
|
+
base64ToArrayBuffer: (base64: string) => ArrayBuffer;
|
|
17
|
+
stringToBuffer: (str: string) => ArrayBuffer;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Returns a `Buffer` instance from the given data URI `uri`.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```typescript
|
|
24
|
+
* import { makeDataUriToBuffer } from "@stryke/core/http";
|
|
25
|
+
*
|
|
26
|
+
* const dataUriToBuffer = makeDataUriToBuffer({
|
|
27
|
+
* base64ToArrayBuffer: (base64) => Buffer.from(base64, "base64").buffer,
|
|
28
|
+
* stringToBuffer: (str) => Buffer.from(str, "utf8")https://avatars.githubusercontent.com/u/99053093?s=64&v=4.buffer,
|
|
29
|
+
* });
|
|
30
|
+
* const parsed = dataUriToBuffer("data:text/plain;base64,SGVsbG8sIFdvcmxkIQ==");
|
|
31
|
+
* console.log(parsed);
|
|
32
|
+
* // {
|
|
33
|
+
* // type: 'text/plain',
|
|
34
|
+
* // typeFull: 'text/plain;base64',
|
|
35
|
+
* // charset: '',
|
|
36
|
+
* // buffer: ArrayBuffer { ... }
|
|
37
|
+
* // }
|
|
38
|
+
* console.log(Buffer.from(parsed.buffer).toString("utf8"));
|
|
39
|
+
* // Hello, World!
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @param convert - Conversion functions
|
|
43
|
+
* @param uri - Data URI to turn into a Buffer instance
|
|
44
|
+
* @throws `TypeError` if `uri` is not a valid Data URI
|
|
45
|
+
* @returns An object containing the parsed data URI properties
|
|
46
|
+
* and the decoded data as a Buffer instance.
|
|
47
|
+
*/
|
|
48
|
+
export declare const makeDataUriToBuffer: (convert: BufferConversionsInterface) => (uri: string | URL) => ParsedDataURI;
|
package/dist/format-data-uri.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const formatDataURI=(t
|
|
1
|
+
export const formatDataURI=(a,t)=>`data:${t};utf8,${encodeURIComponent(a)}`,makeDataUriToBuffer=a=>t=>{if(t=String(t),!/^data:/i.test(t))throw new Error('`uri` does not appear to be a Data URI (must begin with "data:")');t=t.replace(/\r?\n/g,"");const s=t.indexOf(",");if(s===-1||s<=4)throw new Error("malformed data: URI");const e=t.substring(5,s).split(";");let n="",o=!1;const i=e[0]||"text/plain";let f=i;for(let r=1;r<e.length;r++)e[r]==="base64"?o=!0:e[r]&&(f+=`;${e[r]}`,e[r]?.indexOf("charset=")===0&&(n=e[r].substring(8)));!e[0]&&!n.length&&(f+=";charset=US-ASCII",n="US-ASCII");const g=unescape(t.substring(s+1)),c=o?a.base64ToArrayBuffer(g):a.stringToBuffer(g);return{type:i,typeFull:f,charset:n,buffer:c}};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.HttpProxyAgent = void 0;
|
|
7
|
+
var _nodeBuffer = require("node:buffer");
|
|
8
|
+
var _nodeEvents = require("node:events");
|
|
9
|
+
var y = _interopRequireWildcard(require("node:net"));
|
|
10
|
+
var f = _interopRequireWildcard(require("node:tls"));
|
|
11
|
+
var _nodeUrl = require("node:url");
|
|
12
|
+
var _agent = require("./agent.cjs");
|
|
13
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
14
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
15
|
+
class HttpProxyAgent extends _agent.Agent {
|
|
16
|
+
static protocols = ["http", "https"];
|
|
17
|
+
proxy;
|
|
18
|
+
proxyHeaders;
|
|
19
|
+
connectOpts;
|
|
20
|
+
constructor(t, e) {
|
|
21
|
+
super(e), this.proxy = typeof t == "string" ? new _nodeUrl.URL(t) : t, this.proxyHeaders = e?.headers ?? {};
|
|
22
|
+
const o = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, ""),
|
|
23
|
+
s = this.proxy.port ? Number.parseInt(this.proxy.port, 10) : this.proxy.protocol === "https:" ? 443 : 80;
|
|
24
|
+
this.connectOpts = {
|
|
25
|
+
...(e ? m(e, "headers") : null),
|
|
26
|
+
host: o,
|
|
27
|
+
port: s
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
addRequest(t, e) {
|
|
31
|
+
t._header = null, this.setRequestProps(t, e), super.addRequest(t, e);
|
|
32
|
+
}
|
|
33
|
+
setRequestProps(t, e) {
|
|
34
|
+
const {
|
|
35
|
+
proxy: o
|
|
36
|
+
} = this,
|
|
37
|
+
s = e.secureEndpoint ? "https:" : "http:",
|
|
38
|
+
n = t.getHeader("host") || "localhost",
|
|
39
|
+
u = `${s}//${Array.isArray(n) ? n.join("") : n}`,
|
|
40
|
+
c = new _nodeUrl.URL(t.path, u);
|
|
41
|
+
e.port !== 80 && (c.port = String(e.port)), t.path = String(c);
|
|
42
|
+
const r = typeof this.proxyHeaders == "function" ? this.proxyHeaders() : {
|
|
43
|
+
...this.proxyHeaders
|
|
44
|
+
};
|
|
45
|
+
if (o.username || o.password) {
|
|
46
|
+
const p = `${decodeURIComponent(o.username)}:${decodeURIComponent(o.password)}`;
|
|
47
|
+
r["Proxy-Authorization"] = `Basic ${_nodeBuffer.Buffer.from(p).toString("base64")}`;
|
|
48
|
+
}
|
|
49
|
+
r["Proxy-Connection"] || (r["Proxy-Connection"] = this.keepAlive ? "Keep-Alive" : "close");
|
|
50
|
+
for (const p of Object.keys(r)) {
|
|
51
|
+
const a = r[p];
|
|
52
|
+
a && t.setHeader(p, a);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
async connect(t, e) {
|
|
56
|
+
t._header = null, t.path.includes("://") || this.setRequestProps(t, e);
|
|
57
|
+
let o, s;
|
|
58
|
+
t._implicitHeader(), t.outputData && t.outputData.length > 0 && (o = t.outputData[0].data, s = o.indexOf(`\r
|
|
59
|
+
\r
|
|
60
|
+
`) + 4, t.outputData[0].data = t._header + o.substring(s));
|
|
61
|
+
let n;
|
|
62
|
+
return this.proxy.protocol === "https:" ? n = f.connect(this.connectOpts) : n = y.connect(this.connectOpts), await (0, _nodeEvents.once)(n, "connect"), n;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.HttpProxyAgent = HttpProxyAgent;
|
|
66
|
+
function m(i, ...t) {
|
|
67
|
+
const e = {};
|
|
68
|
+
let o;
|
|
69
|
+
for (o in i) t.includes(o) || (e[o] = i[o]);
|
|
70
|
+
return e;
|
|
71
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { AgentConnectOpts } from "agent-base";
|
|
2
|
+
import type { AgentOptions, ClientRequest, OutgoingHttpHeaders } from "node:http";
|
|
3
|
+
import * as net from "node:net";
|
|
4
|
+
import * as tls from "node:tls";
|
|
5
|
+
import { URL } from "node:url";
|
|
6
|
+
import { Agent } from "./agent";
|
|
7
|
+
type Protocol<T> = T extends `${infer Protocol}:${infer _}` ? Protocol : never;
|
|
8
|
+
interface ConnectOptsMap {
|
|
9
|
+
http: Omit<net.TcpNetConnectOpts, "host" | "port">;
|
|
10
|
+
https: Omit<tls.ConnectionOptions, "host" | "port">;
|
|
11
|
+
}
|
|
12
|
+
type ConnectOpts<T> = {
|
|
13
|
+
[P in keyof ConnectOptsMap]: Protocol<T> extends P ? ConnectOptsMap[P] : never;
|
|
14
|
+
}[keyof ConnectOptsMap];
|
|
15
|
+
export type HttpProxyAgentOptions<T> = ConnectOpts<T> & AgentOptions & {
|
|
16
|
+
headers?: OutgoingHttpHeaders | (() => OutgoingHttpHeaders);
|
|
17
|
+
};
|
|
18
|
+
interface HttpProxyAgentClientRequest extends ClientRequest {
|
|
19
|
+
outputData?: {
|
|
20
|
+
data: string;
|
|
21
|
+
}[];
|
|
22
|
+
_header?: string | null;
|
|
23
|
+
_implicitHeader: () => void;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The `HttpProxyAgent` implements an HTTP Agent subclass that connects
|
|
27
|
+
* to the specified "HTTP proxy server" in order to proxy HTTP requests.
|
|
28
|
+
*/
|
|
29
|
+
export declare class HttpProxyAgent<Uri extends string> extends Agent {
|
|
30
|
+
static protocols: readonly ["http", "https"];
|
|
31
|
+
readonly proxy: URL;
|
|
32
|
+
proxyHeaders: OutgoingHttpHeaders | (() => OutgoingHttpHeaders);
|
|
33
|
+
connectOpts: net.TcpNetConnectOpts & tls.ConnectionOptions;
|
|
34
|
+
constructor(proxy: Uri | URL, opts?: HttpProxyAgentOptions<Uri>);
|
|
35
|
+
addRequest(req: HttpProxyAgentClientRequest, opts: AgentConnectOpts): void;
|
|
36
|
+
setRequestProps(req: HttpProxyAgentClientRequest, opts: AgentConnectOpts): void;
|
|
37
|
+
connect(req: HttpProxyAgentClientRequest, opts: AgentConnectOpts): Promise<net.Socket>;
|
|
38
|
+
}
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{Buffer as h}from"node:buffer";import{once as l}from"node:events";import*as y from"node:net";import*as f from"node:tls";import{URL as d}from"node:url";import{Agent as g}from"./agent";export class HttpProxyAgent extends g{static protocols=["http","https"];proxy;proxyHeaders;connectOpts;constructor(t,e){super(e),this.proxy=typeof t=="string"?new d(t):t,this.proxyHeaders=e?.headers??{};const o=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),s=this.proxy.port?Number.parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={...e?m(e,"headers"):null,host:o,port:s}}addRequest(t,e){t._header=null,this.setRequestProps(t,e),super.addRequest(t,e)}setRequestProps(t,e){const{proxy:o}=this,s=e.secureEndpoint?"https:":"http:",n=t.getHeader("host")||"localhost",u=`${s}//${Array.isArray(n)?n.join(""):n}`,c=new d(t.path,u);e.port!==80&&(c.port=String(e.port)),t.path=String(c);const r=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders};if(o.username||o.password){const p=`${decodeURIComponent(o.username)}:${decodeURIComponent(o.password)}`;r["Proxy-Authorization"]=`Basic ${h.from(p).toString("base64")}`}r["Proxy-Connection"]||(r["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(const p of Object.keys(r)){const a=r[p];a&&t.setHeader(p,a)}}async connect(t,e){t._header=null,t.path.includes("://")||this.setRequestProps(t,e);let o,s;t._implicitHeader(),t.outputData&&t.outputData.length>0&&(o=t.outputData[0].data,s=o.indexOf(`\r
|
|
2
|
+
\r
|
|
3
|
+
`)+4,t.outputData[0].data=t._header+o.substring(s));let n;return this.proxy.protocol==="https:"?n=f.connect(this.connectOpts):n=y.connect(this.connectOpts),await l(n,"connect"),n}}function m(i,...t){const e={};let o;for(o in i)t.includes(o)||(e[o]=i[o]);return e}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.HttpsProxyAgent = void 0;
|
|
7
|
+
var _agentBase = require("agent-base");
|
|
8
|
+
var _nodeAssert = _interopRequireDefault(require("node:assert"));
|
|
9
|
+
var _nodeBuffer = require("node:buffer");
|
|
10
|
+
var i = _interopRequireWildcard(require("node:net"));
|
|
11
|
+
var f = _interopRequireWildcard(require("node:tls"));
|
|
12
|
+
var _nodeUrl = require("node:url");
|
|
13
|
+
var _parseResponse = require("./parse-response.cjs");
|
|
14
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
15
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
16
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
+
const y = e => e.servername === void 0 && e.host && !i.isIP(e.host) ? {
|
|
18
|
+
...e,
|
|
19
|
+
servername: e.host
|
|
20
|
+
} : e;
|
|
21
|
+
class HttpsProxyAgent extends _agentBase.Agent {
|
|
22
|
+
static protocols = ["http", "https"];
|
|
23
|
+
proxy;
|
|
24
|
+
proxyHeaders;
|
|
25
|
+
connectOpts;
|
|
26
|
+
constructor(n, t) {
|
|
27
|
+
super(t), this.options = {
|
|
28
|
+
path: void 0
|
|
29
|
+
}, this.proxy = typeof n == "string" ? new _nodeUrl.URL(n) : n, this.proxyHeaders = t?.headers ?? {};
|
|
30
|
+
const o = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, ""),
|
|
31
|
+
r = this.proxy.port ? Number.parseInt(this.proxy.port, 10) : this.proxy.protocol === "https:" ? 443 : 80;
|
|
32
|
+
this.connectOpts = {
|
|
33
|
+
ALPNProtocols: ["http/1.1"],
|
|
34
|
+
...(t ? m(t, "headers") : null),
|
|
35
|
+
host: o,
|
|
36
|
+
port: r
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
async connect(n, t) {
|
|
40
|
+
const {
|
|
41
|
+
proxy: o
|
|
42
|
+
} = this;
|
|
43
|
+
if (!t.host) throw new TypeError('No "host" provided');
|
|
44
|
+
let r;
|
|
45
|
+
o.protocol === "https:" ? r = f.connect(y(this.connectOpts)) : r = i.connect(this.connectOpts);
|
|
46
|
+
const p = typeof this.proxyHeaders == "function" ? this.proxyHeaders() : {
|
|
47
|
+
...this.proxyHeaders
|
|
48
|
+
},
|
|
49
|
+
a = i.isIPv6(t.host) ? `[${t.host}]` : t.host;
|
|
50
|
+
let h = `CONNECT ${a}:${t.port} HTTP/1.1\r
|
|
51
|
+
`;
|
|
52
|
+
if (o.username || o.password) {
|
|
53
|
+
const s = `${decodeURIComponent(o.username)}:${decodeURIComponent(o.password)}`;
|
|
54
|
+
p["Proxy-Authorization"] = `Basic ${_nodeBuffer.Buffer.from(s).toString("base64")}`;
|
|
55
|
+
}
|
|
56
|
+
p.Host = `${a}:${t.port}`, p["Proxy-Connection"] || (p["Proxy-Connection"] = this.keepAlive ? "Keep-Alive" : "close");
|
|
57
|
+
for (const s of Object.keys(p)) h += `${s}: ${p[s]?.toString()}\r
|
|
58
|
+
`;
|
|
59
|
+
const u = (0, _parseResponse.parseProxyResponse)(r);
|
|
60
|
+
r.write(`${h}\r
|
|
61
|
+
`);
|
|
62
|
+
const {
|
|
63
|
+
connect: c,
|
|
64
|
+
buffered: l
|
|
65
|
+
} = await u;
|
|
66
|
+
if (n.emit("proxyConnect", c), this.emit("proxyConnect", c, n), c.statusCode === 200) return n.once("socket", P), t.secureEndpoint ? f.connect({
|
|
67
|
+
...m(y(t), "host", "path", "port"),
|
|
68
|
+
socket: r
|
|
69
|
+
}) : r;
|
|
70
|
+
r.destroy();
|
|
71
|
+
const d = new i.Socket({
|
|
72
|
+
writable: !1
|
|
73
|
+
});
|
|
74
|
+
return d.readable = !0, n.once("socket", s => {
|
|
75
|
+
(0, _nodeAssert.default)(s.listenerCount("data") > 0), s.push(l), s.push(null);
|
|
76
|
+
}), d;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
exports.HttpsProxyAgent = HttpsProxyAgent;
|
|
80
|
+
function P(e) {
|
|
81
|
+
e.resume();
|
|
82
|
+
}
|
|
83
|
+
function m(e, ...n) {
|
|
84
|
+
const t = {};
|
|
85
|
+
let o;
|
|
86
|
+
for (o in e) n.includes(o) || (t[o] = e[o]);
|
|
87
|
+
return t;
|
|
88
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { AgentConnectOpts } from "agent-base";
|
|
2
|
+
import { Agent } from "agent-base";
|
|
3
|
+
import type * as http from "node:http";
|
|
4
|
+
import type { OutgoingHttpHeaders } from "node:http";
|
|
5
|
+
import * as net from "node:net";
|
|
6
|
+
import * as tls from "node:tls";
|
|
7
|
+
import { URL } from "node:url";
|
|
8
|
+
type Protocol<T> = T extends `${infer Protocol}:${infer _}` ? Protocol : never;
|
|
9
|
+
interface ConnectOptsMap {
|
|
10
|
+
http: Omit<net.TcpNetConnectOpts, "host" | "port">;
|
|
11
|
+
https: Omit<tls.ConnectionOptions, "host" | "port">;
|
|
12
|
+
}
|
|
13
|
+
type ConnectOpts<T> = {
|
|
14
|
+
[P in keyof ConnectOptsMap]: Protocol<T> extends P ? ConnectOptsMap[P] : never;
|
|
15
|
+
}[keyof ConnectOptsMap];
|
|
16
|
+
export type HttpsProxyAgentOptions<T> = ConnectOpts<T> & http.AgentOptions & {
|
|
17
|
+
headers?: OutgoingHttpHeaders | (() => OutgoingHttpHeaders);
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to
|
|
21
|
+
* the specified "HTTP(s) proxy server" in order to proxy HTTPS requests.
|
|
22
|
+
*
|
|
23
|
+
* Outgoing HTTP requests are first tunneled through the proxy server using the
|
|
24
|
+
* `CONNECT` HTTP request method to establish a connection to the proxy server,
|
|
25
|
+
* and then the proxy server connects to the destination target and issues the
|
|
26
|
+
* HTTP request from the proxy server.
|
|
27
|
+
*
|
|
28
|
+
* `https:` requests have their socket connection upgraded to TLS once
|
|
29
|
+
* the connection to the proxy server has been established.
|
|
30
|
+
*/
|
|
31
|
+
export declare class HttpsProxyAgent<Uri extends string> extends Agent {
|
|
32
|
+
static protocols: readonly ["http", "https"];
|
|
33
|
+
readonly proxy: URL;
|
|
34
|
+
proxyHeaders: OutgoingHttpHeaders | (() => OutgoingHttpHeaders);
|
|
35
|
+
connectOpts: net.TcpNetConnectOpts & tls.ConnectionOptions;
|
|
36
|
+
constructor(proxy: Uri | URL, opts?: HttpsProxyAgentOptions<Uri>);
|
|
37
|
+
/**
|
|
38
|
+
* Called when the node-core HTTP client library is creating a
|
|
39
|
+
* new HTTP request.
|
|
40
|
+
*/
|
|
41
|
+
connect(req: http.ClientRequest, opts: AgentConnectOpts): Promise<net.Socket>;
|
|
42
|
+
}
|
|
43
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{Agent as x}from"agent-base";import O from"node:assert";import{Buffer as g}from"node:buffer";import*as i from"node:net";import*as f from"node:tls";import{URL as C}from"node:url";import{parseProxyResponse as H}from"./parse-response";const y=e=>e.servername===void 0&&e.host&&!i.isIP(e.host)?{...e,servername:e.host}:e;export class HttpsProxyAgent extends x{static protocols=["http","https"];proxy;proxyHeaders;connectOpts;constructor(n,t){super(t),this.options={path:void 0},this.proxy=typeof n=="string"?new C(n):n,this.proxyHeaders=t?.headers??{};const o=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),r=this.proxy.port?Number.parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...t?m(t,"headers"):null,host:o,port:r}}async connect(n,t){const{proxy:o}=this;if(!t.host)throw new TypeError('No "host" provided');let r;o.protocol==="https:"?r=f.connect(y(this.connectOpts)):r=i.connect(this.connectOpts);const p=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},a=i.isIPv6(t.host)?`[${t.host}]`:t.host;let h=`CONNECT ${a}:${t.port} HTTP/1.1\r
|
|
2
|
+
`;if(o.username||o.password){const s=`${decodeURIComponent(o.username)}:${decodeURIComponent(o.password)}`;p["Proxy-Authorization"]=`Basic ${g.from(s).toString("base64")}`}p.Host=`${a}:${t.port}`,p["Proxy-Connection"]||(p["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(const s of Object.keys(p))h+=`${s}: ${p[s]?.toString()}\r
|
|
3
|
+
`;const u=H(r);r.write(`${h}\r
|
|
4
|
+
`);const{connect:c,buffered:l}=await u;if(n.emit("proxyConnect",c),this.emit("proxyConnect",c,n),c.statusCode===200)return n.once("socket",P),t.secureEndpoint?f.connect({...m(y(t),"host","path","port"),socket:r}):r;r.destroy();const d=new i.Socket({writable:!1});return d.readable=!0,n.once("socket",s=>{O(s.listenerCount("data")>0),s.push(l),s.push(null)}),d}}function P(e){e.resume()}function m(e,...n){const t={};let o;for(o in e)n.includes(o)||(t[o]=e[o]);return t}
|
package/dist/index.cjs
CHANGED
|
@@ -3,14 +3,25 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
var
|
|
7
|
-
Object.keys(
|
|
6
|
+
var _agent = require("./agent.cjs");
|
|
7
|
+
Object.keys(_agent).forEach(function (key) {
|
|
8
8
|
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] ===
|
|
9
|
+
if (key in exports && exports[key] === _agent[key]) return;
|
|
10
10
|
Object.defineProperty(exports, key, {
|
|
11
11
|
enumerable: true,
|
|
12
12
|
get: function () {
|
|
13
|
-
return
|
|
13
|
+
return _agent[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _fetch = require("./fetch.cjs");
|
|
18
|
+
Object.keys(_fetch).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _fetch[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _fetch[key];
|
|
14
25
|
}
|
|
15
26
|
});
|
|
16
27
|
});
|
|
@@ -25,14 +36,47 @@ Object.keys(_formatDataUri).forEach(function (key) {
|
|
|
25
36
|
}
|
|
26
37
|
});
|
|
27
38
|
});
|
|
28
|
-
var
|
|
29
|
-
Object.keys(
|
|
39
|
+
var _httpProxy = require("./http-proxy.cjs");
|
|
40
|
+
Object.keys(_httpProxy).forEach(function (key) {
|
|
41
|
+
if (key === "default" || key === "__esModule") return;
|
|
42
|
+
if (key in exports && exports[key] === _httpProxy[key]) return;
|
|
43
|
+
Object.defineProperty(exports, key, {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function () {
|
|
46
|
+
return _httpProxy[key];
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
var _httpsProxy = require("./https-proxy.cjs");
|
|
51
|
+
Object.keys(_httpsProxy).forEach(function (key) {
|
|
52
|
+
if (key === "default" || key === "__esModule") return;
|
|
53
|
+
if (key in exports && exports[key] === _httpsProxy[key]) return;
|
|
54
|
+
Object.defineProperty(exports, key, {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _httpsProxy[key];
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
var _parseResponse = require("./parse-response.cjs");
|
|
62
|
+
Object.keys(_parseResponse).forEach(function (key) {
|
|
63
|
+
if (key === "default" || key === "__esModule") return;
|
|
64
|
+
if (key in exports && exports[key] === _parseResponse[key]) return;
|
|
65
|
+
Object.defineProperty(exports, key, {
|
|
66
|
+
enumerable: true,
|
|
67
|
+
get: function () {
|
|
68
|
+
return _parseResponse[key];
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
var _proxyAgent = require("./proxy-agent.cjs");
|
|
73
|
+
Object.keys(_proxyAgent).forEach(function (key) {
|
|
30
74
|
if (key === "default" || key === "__esModule") return;
|
|
31
|
-
if (key in exports && exports[key] ===
|
|
75
|
+
if (key in exports && exports[key] === _proxyAgent[key]) return;
|
|
32
76
|
Object.defineProperty(exports, key, {
|
|
33
77
|
enumerable: true,
|
|
34
78
|
get: function () {
|
|
35
|
-
return
|
|
79
|
+
return _proxyAgent[key];
|
|
36
80
|
}
|
|
37
81
|
});
|
|
38
82
|
});
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
export * from "./
|
|
1
|
+
export * from "./agent";
|
|
2
|
+
export * from "./fetch";
|
|
2
3
|
export * from "./format-data-uri";
|
|
3
|
-
export * from "./
|
|
4
|
+
export * from "./http-proxy";
|
|
5
|
+
export * from "./https-proxy";
|
|
6
|
+
export * from "./parse-response";
|
|
7
|
+
export * from "./proxy-agent";
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export*from"./
|
|
1
|
+
export*from"./agent";export*from"./fetch";export*from"./format-data-uri";export*from"./http-proxy";export*from"./https-proxy";export*from"./parse-response";export*from"./proxy-agent";
|