@ekhein/http-request 1.0.28 → 2.0.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.
@@ -1,6 +1,6 @@
1
1
  import { ProxyAgent } from 'proxy-agent';
2
2
  export declare class AndroidProxy extends ProxyAgent {
3
- constructor(opts: {
3
+ constructor(options: {
4
4
  clientIp: string;
5
5
  });
6
6
  }
@@ -1,13 +1,17 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.AndroidProxy = void 0;
7
+ const util_1 = __importDefault(require("util"));
4
8
  const proxy_agent_1 = require("proxy-agent");
5
9
  class AndroidProxy extends proxy_agent_1.ProxyAgent {
6
- constructor(opts) {
10
+ constructor(options) {
7
11
  super({
8
- getProxyForUrl: () => {
9
- return ("http://*:65000".replace("*", opts.clientIp));
10
- },
12
+ getProxyForUrl() {
13
+ return util_1.default.format("http://%s:65000", options.clientIp);
14
+ }
11
15
  });
12
16
  }
13
17
  }