@ekhein/http-request 1.0.23 → 1.0.25
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/index.d.ts +5 -5
- package/dist/agent/index.js +3 -3
- package/dist/http-request.js +2 -2
- package/dist/proxy/{phone4g.proxy.d.ts → android.proxy.d.ts} +1 -1
- package/dist/proxy/{phone4g.proxy.js → android.proxy.js} +3 -3
- package/dist/proxy/index.d.ts +1 -1
- package/dist/proxy/index.js +3 -3
- package/package.json +1 -1
- package/types/http-request.d.ts +2 -2
- package/types/index.d.ts +1 -0
package/dist/agent/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { CookieAgentOptions, HttpCookieAgent, HttpsCookieAgent } from 'http-cookie-agent/http';
|
|
2
|
-
import { LiuGuanProxy,
|
|
3
|
-
export declare const
|
|
2
|
+
import { LiuGuanProxy, AndroidProxy } from '../proxy';
|
|
3
|
+
export declare const HttpCookieWithAndroidProxyAgent: new (rest_0: {
|
|
4
4
|
clientIp: string;
|
|
5
|
-
}, rest_1: CookieAgentOptions) =>
|
|
6
|
-
export declare const
|
|
5
|
+
}, rest_1: CookieAgentOptions) => AndroidProxy;
|
|
6
|
+
export declare const HttpsCookieWithAndroidProxyAgent: new (rest_0: {
|
|
7
7
|
clientIp: string;
|
|
8
|
-
}, rest_1: CookieAgentOptions) =>
|
|
8
|
+
}, rest_1: CookieAgentOptions) => AndroidProxy;
|
|
9
9
|
export declare const HttpCookieWithLiuGuanProxyAgent: new (rest_0: {
|
|
10
10
|
adcode?: string;
|
|
11
11
|
visitorId?: string;
|
package/dist/agent/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HttpsCookieAgent = exports.HttpCookieAgent = exports.HttpsCookieWithLiuGuanProxyAgent = exports.HttpCookieWithLiuGuanProxyAgent = exports.
|
|
3
|
+
exports.HttpsCookieAgent = exports.HttpCookieAgent = exports.HttpsCookieWithLiuGuanProxyAgent = exports.HttpCookieWithLiuGuanProxyAgent = exports.HttpsCookieWithAndroidProxyAgent = exports.HttpCookieWithAndroidProxyAgent = void 0;
|
|
4
4
|
const http_1 = require("http-cookie-agent/http");
|
|
5
5
|
Object.defineProperty(exports, "HttpCookieAgent", { enumerable: true, get: function () { return http_1.HttpCookieAgent; } });
|
|
6
6
|
Object.defineProperty(exports, "HttpsCookieAgent", { enumerable: true, get: function () { return http_1.HttpsCookieAgent; } });
|
|
7
7
|
const proxy_1 = require("../proxy");
|
|
8
|
-
exports.
|
|
9
|
-
exports.
|
|
8
|
+
exports.HttpCookieWithAndroidProxyAgent = (0, http_1.createCookieAgent)(proxy_1.AndroidProxy);
|
|
9
|
+
exports.HttpsCookieWithAndroidProxyAgent = (0, http_1.createCookieAgent)(proxy_1.AndroidProxy);
|
|
10
10
|
exports.HttpCookieWithLiuGuanProxyAgent = (0, http_1.createCookieAgent)(proxy_1.LiuGuanProxy);
|
|
11
11
|
exports.HttpsCookieWithLiuGuanProxyAgent = (0, http_1.createCookieAgent)(proxy_1.LiuGuanProxy);
|
package/dist/http-request.js
CHANGED
|
@@ -89,8 +89,8 @@ class HttpRequest {
|
|
|
89
89
|
}
|
|
90
90
|
if (typeof request.useProxy === "object") {
|
|
91
91
|
if ("clientIp" in request.useProxy) {
|
|
92
|
-
request.httpAgent = new agent_2.
|
|
93
|
-
request.httpsAgent = new agent_2.
|
|
92
|
+
request.httpAgent = new agent_2.HttpCookieWithAndroidProxyAgent(request.useProxy, { cookies });
|
|
93
|
+
request.httpsAgent = new agent_2.HttpsCookieWithAndroidProxyAgent(request.useProxy, { cookies });
|
|
94
94
|
}
|
|
95
95
|
else {
|
|
96
96
|
request.httpAgent = new agent_3.HttpCookieWithLiuGuanProxyAgent(request.useProxy, { cookies });
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.AndroidProxy = void 0;
|
|
4
4
|
const proxy_agent_1 = require("proxy-agent");
|
|
5
|
-
class
|
|
5
|
+
class AndroidProxy extends proxy_agent_1.ProxyAgent {
|
|
6
6
|
constructor(opts) {
|
|
7
7
|
super({
|
|
8
8
|
getProxyForUrl: () => {
|
|
@@ -11,4 +11,4 @@ class Phone4GProxy extends proxy_agent_1.ProxyAgent {
|
|
|
11
11
|
});
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
exports.
|
|
14
|
+
exports.AndroidProxy = AndroidProxy;
|
package/dist/proxy/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { LiuGuanProxy } from './liuguan.proxy';
|
|
2
|
-
export {
|
|
2
|
+
export { AndroidProxy } from './android.proxy';
|
package/dist/proxy/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.AndroidProxy = exports.LiuGuanProxy = void 0;
|
|
4
4
|
var liuguan_proxy_1 = require("./liuguan.proxy");
|
|
5
5
|
Object.defineProperty(exports, "LiuGuanProxy", { enumerable: true, get: function () { return liuguan_proxy_1.LiuGuanProxy; } });
|
|
6
|
-
var
|
|
7
|
-
Object.defineProperty(exports, "
|
|
6
|
+
var android_proxy_1 = require("./android.proxy");
|
|
7
|
+
Object.defineProperty(exports, "AndroidProxy", { enumerable: true, get: function () { return android_proxy_1.AndroidProxy; } });
|
package/package.json
CHANGED
package/types/http-request.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export interface HttpLiuGuanProxy {
|
|
|
8
8
|
unbindTime?: string
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
export interface
|
|
11
|
+
export interface HttpAndroidProxy {
|
|
12
12
|
clientIp: string
|
|
13
13
|
}
|
|
14
14
|
|
|
@@ -31,7 +31,7 @@ export interface ExtendAxiosRequestConfig extends Record<string, any> {
|
|
|
31
31
|
html?: boolean
|
|
32
32
|
resolveBodyOnly?: boolean
|
|
33
33
|
serviceType?: HttpServiceTypes[keyof HttpServiceTypes]
|
|
34
|
-
useProxy?: boolean | HttpLiuGuanProxy |
|
|
34
|
+
useProxy?: boolean | HttpLiuGuanProxy | HttpAndroidProxy
|
|
35
35
|
jar?: CookieJar
|
|
36
36
|
interceptorHooks?: {
|
|
37
37
|
requestInterceptor?: (config: ExtendInternalAxiosRequestConfig) => ExtendInternalAxiosRequestConfig | Promise<ExtendInternalAxiosRequestConfig>
|
package/types/index.d.ts
CHANGED