UNPKG

allproxy

Version:

AllProxy: MITM HTTP Debugging Tool.

54 lines 2.8 kB
"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.EPHEMERAL_PORT_RANGE = exports.ALLOWED_ORIGINS = exports.APP_ROOT = exports.IS_PROD_BUILD = void 0; const path = __importStar(require("path")); exports.IS_PROD_BUILD = !!process.env.HTTPTOOLKIT_SERVER_BINPATH; // Notably, for this file, this is the same when either bundled or unbundled. // That's not true for most other files! Everything should use this instead of __dirname: exports.APP_ROOT = path.join(__dirname, '..'); exports.ALLOWED_ORIGINS = exports.IS_PROD_BUILD ? [ // Prod builds only allow HTTPS app.httptoolkit.tech usage. This // ensures that no other sites/apps can communicate with your server // whilst you have the app open. If they could (requires an HTTP mitm), // they would be able to start proxies & interceptors. /^https:\/\/app\.httptoolkit\.tech$/ ] : [ // Dev builds can use the main site, or local sites, even if those // use HTTP. Note that HTTP here could technically open you to the risk // above, but it'd require a DNS MitM too (to stop local.httptoolkit.tech // resolving to localhost and never hitting the network). /^https?:\/\/localhost(:\d+)?$/, /^http:\/\/local\.httptoolkit\.tech(:\d+)?$/, /^https:\/\/app\.httptoolkit\.tech$/ ]; // The range of ports that should be used by invisible ephemeral services, such as Firefox's // certificate check server and Chrome's "hide warning" server. These ports are extra likely // not to conflict with normal user usage, and are specifically designated by the IANA for // use for dynamic ports. exports.EPHEMERAL_PORT_RANGE = { startPort: 49152, endPort: 65535 }; //# sourceMappingURL=constants.js.map