nitro 3.0.260429-beta → 3.0.260522-beta

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.
Files changed (75) hide show
  1. package/dist/THIRD-PARTY-LICENSES.md.gz +0 -0
  2. package/dist/_build/common.mjs +119 -21
  3. package/dist/_build/rolldown.mjs +6 -6
  4. package/dist/_build/rollup.mjs +11 -11
  5. package/dist/_build/vite.build.mjs +3 -3
  6. package/dist/_build/vite.dev.mjs +149 -0
  7. package/dist/_build/vite.env.mjs +177 -0
  8. package/dist/_chunks/nitro.mjs +239 -12
  9. package/dist/_chunks/nitro2.mjs +117 -90
  10. package/dist/_chunks/utils.mjs +4 -4
  11. package/dist/_common.mjs +1 -1
  12. package/dist/_dev.d.mts +1 -1
  13. package/dist/_dev.mjs +5 -5
  14. package/dist/_libs/c12+rc9.mjs +11 -10
  15. package/dist/_libs/c12+readdirp+chokidar.d.mts +7 -8
  16. package/dist/_libs/citty.mjs +1 -1
  17. package/dist/_libs/common.d.mts +37 -0
  18. package/dist/_libs/commondir+is-reference.mjs +3 -3
  19. package/dist/_libs/compatx.d.mts +1 -1
  20. package/dist/_libs/compatx.mjs +1 -1
  21. package/dist/_libs/estree+pluginutils.d.mts +1 -1
  22. package/dist/_libs/estree-walker.mjs +1 -1
  23. package/dist/_libs/hasown+resolve+deepmerge.mjs +15 -15
  24. package/dist/_libs/httpxy.d.mts +1 -1
  25. package/dist/_libs/httpxy.mjs +8 -4
  26. package/dist/_libs/jsonc-parser+workers-utils.d.mts +1579 -0
  27. package/dist/_libs/klona.mjs +1 -1
  28. package/dist/_libs/magic-string.d.mts +1 -1
  29. package/dist/_libs/mlly.d.mts +1 -1
  30. package/dist/_libs/nypm+tinyexec.mjs +92 -99
  31. package/dist/_libs/openapi-types.d.mts +730 -0
  32. package/dist/_libs/perfect-debounce.mjs +1 -1
  33. package/dist/_libs/pkg-types.d.mts +1 -1
  34. package/dist/_libs/plugin-alias.mjs +2 -2
  35. package/dist/_libs/plugin-inject.mjs +3 -3
  36. package/dist/_libs/plugin-json.mjs +2 -2
  37. package/dist/_libs/pluginutils.mjs +16 -5
  38. package/dist/_libs/readdirp+chokidar.mjs +2 -2
  39. package/dist/_libs/remapping.mjs +2 -2
  40. package/dist/_libs/resolve-uri+gen-mapping.mjs +2 -5
  41. package/dist/_libs/rou3.d.mts +1 -1
  42. package/dist/_libs/rou3.mjs +1 -1
  43. package/dist/_libs/std-env.d.mts +1 -1
  44. package/dist/_libs/tsconfck.mjs +1 -1
  45. package/dist/_libs/ultrahtml.mjs +1 -1
  46. package/dist/_libs/{unimport+unplugin+oxc-parser.mjs → unimport+unplugin.mjs} +18 -8
  47. package/dist/_libs/unplugin+unimport.d.mts +3 -3
  48. package/dist/_libs/unwasm.d.mts +1 -1
  49. package/dist/_presets.mjs +117 -91
  50. package/dist/builder.d.mts +1 -1
  51. package/dist/builder.mjs +3 -3
  52. package/dist/cli/_chunks/build.mjs +3 -3
  53. package/dist/cli/_chunks/common.mjs +1 -1
  54. package/dist/cli/_chunks/deploy.mjs +2 -2
  55. package/dist/cli/_chunks/dev.mjs +4 -4
  56. package/dist/cli/_chunks/docs.mjs +1 -1
  57. package/dist/cli/_chunks/list.mjs +2 -2
  58. package/dist/cli/_chunks/prepare.mjs +3 -3
  59. package/dist/cli/_chunks/preview.mjs +4 -4
  60. package/dist/cli/_chunks/run.mjs +2 -2
  61. package/dist/cli/_chunks/task.mjs +1 -1
  62. package/dist/cli/index.mjs +1 -1
  63. package/dist/docs/1.deploy/2.providers/2.aws-amplify.md +3 -3
  64. package/dist/docs/1.deploy/2.providers/21.vercel.md +6 -0
  65. package/dist/docs/3.examples/27.vite-ssr-tsr-react.md +1 -1
  66. package/dist/presets/vercel/runtime/queue.dev.mjs +41 -0
  67. package/dist/runtime/internal/app.mjs +4 -111
  68. package/dist/runtime/virtual/app.d.mts +4 -0
  69. package/dist/runtime/virtual/app.mjs +32 -0
  70. package/dist/types/index.d.mts +21 -1756
  71. package/dist/vite.mjs +23 -337
  72. package/package.json +37 -39
  73. package/dist/THIRD-PARTY-LICENSES.md +0 -1676
  74. package/dist/_chunks/nitro3.mjs +0 -136
  75. package/dist/_chunks/nitro4.mjs +0 -127
@@ -1,5 +1,5 @@
1
- import { r as __require, t as __commonJSMin } from "../_common.mjs";
2
- import { H as m, M as glob, U as v, dt as relative, ft as resolve, ot as dirname, p as runParallel, rt as resolveModulePath } from "../_build/common.mjs";
1
+ import { __commonJSMin, __require } from "../_common.mjs";
2
+ import { dirname, glob, m, relative, resolve, resolveModulePath, runParallel, v } from "../_build/common.mjs";
3
3
  import { consola as consola$1 } from "consola";
4
4
  import { promises } from "node:fs";
5
5
  import { promisify } from "node:util";
@@ -257,9 +257,9 @@ async function importDep(opts, _retry) {
257
257
  if (!shouldInstall) throw new Error(`\`${opts.id}\` is not installed. Please add it to your dependencies for ${opts.reason}.`);
258
258
  const start = Date.now();
259
259
  consola$1.start(`Installing \`${opts.id}\` in \`${opts.dir}\`...`);
260
- const { addDevDependency } = await import("../_libs/nypm+tinyexec.mjs").then((n) => n.t);
260
+ const { addDevDependency } = await import("../_libs/nypm+tinyexec.mjs").then((n) => n.dist_exports);
261
261
  await addDevDependency(opts.id, { cwd: opts.dir });
262
262
  consola$1.success(`Installed \`${opts.id}\` in ${opts.dir} (${Date.now() - start}ms).`);
263
263
  return importDep(opts, true);
264
264
  }
265
- export { generateFSTree as n, importDep as t };
265
+ export { generateFSTree, importDep };
package/dist/_common.mjs CHANGED
@@ -30,4 +30,4 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
30
30
  enumerable: true
31
31
  }) : target, mod));
32
32
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
33
- export { __toESM as i, __exportAll as n, __require as r, __commonJSMin as t };
33
+ export { __commonJSMin, __exportAll, __require, __toESM };
package/dist/_dev.d.mts CHANGED
@@ -6,4 +6,4 @@ declare class NitroDevApp {
6
6
  fetch: (req: Request) => Response | Promise<Response>;
7
7
  constructor(nitro: Nitro, catchAllHandler?: HTTPHandler);
8
8
  }
9
- export { NitroDevApp as t };
9
+ export { NitroDevApp };
package/dist/_dev.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { A as src_default, H as m, U as v, ft as resolve$1, g as writeDevBuildInfo, lt as join$1, st as extname$1 } from "./_build/common.mjs";
2
- import { n as watch$1 } from "./_libs/readdirp+chokidar.mjs";
3
- import { t as debounce } from "./_libs/perfect-debounce.mjs";
4
- import { t as createProxyServer } from "./_libs/httpxy.mjs";
1
+ import { extname as extname$1, join as join$1, m, resolve as resolve$1, src_default, v, writeDevBuildInfo } from "./_build/common.mjs";
2
+ import { watch as watch$1 } from "./_libs/readdirp+chokidar.mjs";
3
+ import { debounce } from "./_libs/perfect-debounce.mjs";
4
+ import { createProxyServer } from "./_libs/httpxy.mjs";
5
5
  import consola from "consola";
6
6
  import { createReadStream } from "node:fs";
7
7
  import { readFile, stat as stat$1 } from "node:fs/promises";
@@ -507,4 +507,4 @@ var NitroDevServer = class NitroDevServer extends NitroDevApp {
507
507
  });
508
508
  }
509
509
  };
510
- export { createDevServer as n, NitroDevApp as r, NitroDevServer as t };
510
+ export { NitroDevApp, NitroDevServer, createDevServer };
@@ -1,5 +1,5 @@
1
- import { n as __exportAll$1 } from "../_common.mjs";
2
- import { Y as readPackageJSON, at as basename$1, ft as resolve$1, lt as join$1, ot as dirname$1, q as findWorkspaceDir, rt as resolveModulePath, st as extname$1, ut as normalize$1 } from "../_build/common.mjs";
1
+ import { __exportAll as __exportAll$1 } from "../_common.mjs";
2
+ import { basename as basename$1, dirname as dirname$1, extname as extname$1, findWorkspaceDir, join as join$1, normalize as normalize$1, readPackageJSON, resolve as resolve$1, resolveModulePath } from "../_build/common.mjs";
3
3
  import { existsSync, readFileSync, statSync } from "node:fs";
4
4
  import * as nodeUtil from "node:util";
5
5
  import { readFile, rm } from "node:fs/promises";
@@ -304,11 +304,11 @@ function getDotEnvVars(targetEnvironment) {
304
304
  const _normalize = (p) => p?.replace(/\\/g, "/");
305
305
  let importCounter = 0;
306
306
  const ASYNC_LOADERS = {
307
- ".yaml": () => import("../_build/common.mjs").then((n) => n.$).then((r) => r.parseYAML),
308
- ".yml": () => import("../_build/common.mjs").then((n) => n.$).then((r) => r.parseYAML),
309
- ".jsonc": () => import("../_build/common.mjs").then((n) => n.et).then((r) => r.parseJSONC),
310
- ".json5": () => import("../_build/common.mjs").then((n) => n.nt).then((r) => r.parseJSON5),
311
- ".toml": () => import("../_build/common.mjs").then((n) => n.Z).then((r) => r.parseTOML)
307
+ ".yaml": () => import("../_build/common.mjs").then((n) => n.yaml_exports).then((r) => r.parseYAML),
308
+ ".yml": () => import("../_build/common.mjs").then((n) => n.yaml_exports).then((r) => r.parseYAML),
309
+ ".jsonc": () => import("../_build/common.mjs").then((n) => n.jsonc_exports).then((r) => r.parseJSONC),
310
+ ".json5": () => import("../_build/common.mjs").then((n) => n.json5_exports).then((r) => r.parseJSON5),
311
+ ".toml": () => import("../_build/common.mjs").then((n) => n.toml_exports).then((r) => r.parseTOML)
312
312
  };
313
313
  const SUPPORTED_EXTENSIONS = Object.freeze([
314
314
  ".js",
@@ -539,7 +539,8 @@ async function resolveConfig(source, options, sourceOptions = {}) {
539
539
  const jiti = createJiti(join$1(options.cwd || ".", options.configFile || "/"), {
540
540
  interopDefault: true,
541
541
  moduleCache: false,
542
- extensions: [...SUPPORTED_EXTENSIONS]
542
+ extensions: [...SUPPORTED_EXTENSIONS],
543
+ ...options.jitiOptions
543
544
  });
544
545
  options.import = (id) => jiti.import(id);
545
546
  return _resolveModule(await options.import(res.configFile));
@@ -597,7 +598,7 @@ async function watchConfig(options) {
597
598
  options.rcFile && resolve$1(l.cwd, typeof options.rcFile === "string" ? options.rcFile : `.${configName}rc`),
598
599
  options.packageJson && resolve$1(l.cwd, "package.json")
599
600
  ]).filter(Boolean))];
600
- const watch = await import("./readdirp+chokidar.mjs").then((n) => n.t).then((r) => r.watch || r.default || r);
601
+ const watch = await import("./readdirp+chokidar.mjs").then((n) => n.chokidar_exports).then((r) => r.watch || r.default || r);
601
602
  const { diff } = await Promise.resolve().then(() => ohash_exports).then((n) => n.t);
602
603
  const _fswatcher = watch(watchingFiles, {
603
604
  ignoreInitial: true,
@@ -823,4 +824,4 @@ var DiffHashedObject = class {
823
824
  return `${k}(${this.value})`;
824
825
  }
825
826
  };
826
- export { watchConfig as i, dist_exports$1 as n, loadConfig as r, ohash_exports as t };
827
+ export { dist_exports$1 as dist_exports, loadConfig, watchConfig };
@@ -1,8 +1,8 @@
1
1
  import { Stats } from "node:fs";
2
2
  import { EventEmitter } from "node:events";
3
3
  import { Readable } from "node:stream";
4
+ import * as _$jiti from "jiti";
4
5
  import { DownloadTemplateOptions } from "giget";
5
- //#region node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/utils/index.d.mts
6
6
  /**
7
7
  * Calculates the difference between two objects and returns a list of differences.
8
8
  *
@@ -29,7 +29,7 @@ declare class DiffHashedObject {
29
29
  constructor(key: string, value: any, hash?: string | undefined, props?: Record<string, DiffHashedObject> | undefined);
30
30
  toString(): string;
31
31
  toJSON(): string;
32
- } //#endregion
32
+ }
33
33
  type AWF = {
34
34
  stabilityThreshold: number;
35
35
  pollInterval: number;
@@ -57,7 +57,6 @@ interface MatcherObject {
57
57
  recursive?: boolean;
58
58
  }
59
59
  type Matcher = string | RegExp | MatchFunction | MatcherObject;
60
- //#region src/dotenv.d.ts
61
60
  interface DotenvOptions {
62
61
  /**
63
62
  * The project root directory (either absolute or relative to the current working directory).
@@ -105,8 +104,8 @@ interface DotenvOptions {
105
104
  }
106
105
  declare global {
107
106
  var __c12_dotenv_vars__: Map<Record<string, any>, Set<string>>;
108
- } //#endregion
109
- //#region src/types.d.ts
107
+ }
108
+ type JitiOptions = NonNullable<Parameters<typeof _$jiti.createJiti>[1]>;
110
109
  interface ConfigLayerMeta {
111
110
  name?: string;
112
111
  [key: string]: any;
@@ -188,6 +187,8 @@ interface LoadConfigOptions<T extends UserInputConfig = UserInputConfig, MT exte
188
187
  import?: (id: string) => Promise<unknown>;
189
188
  /** Custom resolver for picking which export to use from the loaded module. Default: `(mod) => mod.default || mod` */
190
189
  resolveModule?: (mod: any) => any;
190
+ /** Options to override defaults when c12 falls back to [jiti](https://github.com/unjs/jiti) for loading config files. */
191
+ jitiOptions?: JitiOptions;
191
192
  giget?: false | DownloadTemplateOptions;
192
193
  merger?: (...sources: Array<T | null | undefined>) => T;
193
194
  extend?: false | {
@@ -195,8 +196,6 @@ interface LoadConfigOptions<T extends UserInputConfig = UserInputConfig, MT exte
195
196
  };
196
197
  configFileRequired?: boolean;
197
198
  }
198
- //#endregion
199
- //#region src/watch.d.ts
200
199
  type DiffEntries = ReturnType<typeof diff>;
201
200
  type ConfigWatcher<T extends UserInputConfig = UserInputConfig, MT extends ConfigLayerMeta = ConfigLayerMeta> = ResolvedConfig<T, MT> & {
202
201
  watchingFiles: string[];
@@ -220,4 +219,4 @@ interface WatchConfigOptions<T extends UserInputConfig = UserInputConfig, MT ext
220
219
  oldConfig: ResolvedConfig<T, MT>;
221
220
  }) => void | Promise<void>;
222
221
  }
223
- export { WatchConfigOptions as a, ResolvedConfig as i, ConfigWatcher as n, ChokidarOptions as o, DotenvOptions as r, C12InputConfig as t };
222
+ export { C12InputConfig, ChokidarOptions, type ConfigWatcher, type DotenvOptions, ResolvedConfig, type WatchConfigOptions };
@@ -461,4 +461,4 @@ function _getBuiltinFlags(long, short, userNames, userAliases) {
461
461
  if (userNames.has(short) || userAliases.has(short)) return [`--${long}`];
462
462
  return [`--${long}`, `-${short}`];
463
463
  }
464
- export { runMain as n, defineCommand as t };
464
+ export { defineCommand, runMain };
@@ -0,0 +1,37 @@
1
+ interface OutputBundleConfig {
2
+ version: "v1";
3
+ runConfig: RunConfig;
4
+ metadata: Metadata;
5
+ outputFiles?: OutputFiles;
6
+ }
7
+ interface RunConfig {
8
+ runCommand: string;
9
+ environmentVariables?: EnvVarConfig[];
10
+ concurrency?: number;
11
+ cpu?: number;
12
+ memoryMiB?: number;
13
+ minInstances?: number;
14
+ maxInstances?: number;
15
+ }
16
+ interface Metadata {
17
+ adapterPackageName: string;
18
+ adapterVersion: string;
19
+ framework: string;
20
+ frameworkVersion?: string;
21
+ }
22
+ interface OutputFiles {
23
+ serverApp: ServerApp;
24
+ }
25
+ interface ServerApp {
26
+ include: string[];
27
+ }
28
+ interface EnvVarConfig {
29
+ variable: string;
30
+ value: string;
31
+ availability: Availability[];
32
+ }
33
+ declare enum Availability {
34
+ Runtime = "RUNTIME",
35
+ Build = "BUILD"
36
+ }
37
+ export { OutputBundleConfig };
@@ -1,5 +1,5 @@
1
- import { i as __toESM, r as __require, t as __commonJSMin } from "../_common.mjs";
2
- import { P as Builder, S as MagicString, c as walk, i as createFilter, o as extractAssignedNames, r as attachScopes, s as makeLegalIdentifier } from "../_build/common.mjs";
1
+ import { __commonJSMin, __require, __toESM } from "../_common.mjs";
2
+ import { Builder, MagicString, attachScopes, createFilter, extractAssignedNames, makeLegalIdentifier, walk } from "../_build/common.mjs";
3
3
  import { existsSync, readFileSync, statSync } from "fs";
4
4
  import { basename, dirname, extname, join, relative, resolve, sep } from "path";
5
5
  var import_commondir = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
@@ -1301,4 +1301,4 @@ function commonjs(options = {}) {
1301
1301
  }
1302
1302
  };
1303
1303
  }
1304
- export { commonjs as t };
1304
+ export { commonjs };
@@ -42,4 +42,4 @@ type CompatibilityDateSpec = DateString | Partial<CompatibilityDates>;
42
42
  /**
43
43
  * Get compatibility updates applicable for the user given platform and date range.
44
44
  */
45
- export { CompatibilityDates as n, DateString as r, CompatibilityDateSpec as t };
45
+ export type { CompatibilityDateSpec, CompatibilityDates, DateString };
@@ -40,4 +40,4 @@ function normalizeDate(date) {
40
40
  if (date === "latest") return /* @__PURE__ */ new Date();
41
41
  return new Date(date);
42
42
  }
43
- export { resolveCompatibilityDates as n, resolveCompatibilityDatesFromEnv as r, formatCompatibilityDate as t };
43
+ export { formatCompatibilityDate, resolveCompatibilityDates, resolveCompatibilityDatesFromEnv };
@@ -233,4 +233,4 @@ interface RollupCommonJSOptions {
233
233
  * Convert CommonJS modules to ES6, so they can be included in a Rollup bundle
234
234
  */
235
235
  declare function commonjs(options?: RollupCommonJSOptions): Plugin;
236
- export { commonjs as t };
236
+ export { commonjs };
@@ -96,4 +96,4 @@ function isNode(value) {
96
96
  function walk(ast, { enter, leave }) {
97
97
  return new SyncWalker(enter, leave).visit(ast, null);
98
98
  }
99
- export { walk as t };
99
+ export { walk };
@@ -1,5 +1,5 @@
1
- import { i as __toESM, r as __require, t as __commonJSMin } from "../_common.mjs";
2
- import { i as createFilter } from "../_build/common.mjs";
1
+ import { __commonJSMin, __require, __toESM } from "../_common.mjs";
2
+ import { createFilter } from "../_build/common.mjs";
3
3
  import { builtinModules } from "module";
4
4
  import fs, { realpathSync } from "fs";
5
5
  import path, { dirname, extname, normalize, resolve, sep } from "path";
@@ -346,18 +346,18 @@ var require_core$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
346
346
  "node:sea": [">= 20.12 && < 21", ">= 21.7"],
347
347
  "smalloc": ">= 0.11.5 && < 3",
348
348
  "node:sqlite": [">= 22.13 && < 23", ">= 23.4"],
349
- "_stream_duplex": ">= 0.9.4",
350
- "node:_stream_duplex": [">= 14.18 && < 15", ">= 16"],
351
- "_stream_transform": ">= 0.9.4",
352
- "node:_stream_transform": [">= 14.18 && < 15", ">= 16"],
353
- "_stream_wrap": ">= 1.4.1",
354
- "node:_stream_wrap": [">= 14.18 && < 15", ">= 16"],
355
- "_stream_passthrough": ">= 0.9.4",
356
- "node:_stream_passthrough": [">= 14.18 && < 15", ">= 16"],
357
- "_stream_readable": ">= 0.9.4",
358
- "node:_stream_readable": [">= 14.18 && < 15", ">= 16"],
359
- "_stream_writable": ">= 0.9.4",
360
- "node:_stream_writable": [">= 14.18 && < 15", ">= 16"],
349
+ "_stream_duplex": ">= 0.9.4 && < 26",
350
+ "node:_stream_duplex": [">= 14.18 && < 15", ">= 16 && < 26"],
351
+ "_stream_transform": ">= 0.9.4 && < 26",
352
+ "node:_stream_transform": [">= 14.18 && < 15", ">= 16 && < 26"],
353
+ "_stream_wrap": ">= 1.4.1 && < 26",
354
+ "node:_stream_wrap": [">= 14.18 && < 15", ">= 16 && < 26"],
355
+ "_stream_passthrough": ">= 0.9.4 && < 26",
356
+ "node:_stream_passthrough": [">= 14.18 && < 15", ">= 16 && < 26"],
357
+ "_stream_readable": ">= 0.9.4 && < 26",
358
+ "node:_stream_readable": [">= 14.18 && < 15", ">= 16 && < 26"],
359
+ "_stream_writable": ">= 0.9.4 && < 26",
360
+ "node:_stream_writable": [">= 14.18 && < 15", ">= 16 && < 26"],
361
361
  "stream": true,
362
362
  "node:stream": [">= 14.18 && < 15", ">= 16"],
363
363
  "stream/consumers": ">= 16.7",
@@ -1896,4 +1896,4 @@ function nodeResolve(opts = {}) {
1896
1896
  }
1897
1897
  };
1898
1898
  }
1899
- export { nodeResolve as t };
1899
+ export { nodeResolve };
@@ -81,4 +81,4 @@ interface ProxyServerOptions {
81
81
  /** Buffer */
82
82
  buffer?: stream.Stream;
83
83
  }
84
- export { ProxyServerOptions as t };
84
+ export type { ProxyServerOptions };
@@ -40,6 +40,10 @@ function setupOutgoing(outgoing, options, req, forward) {
40
40
  const value = options[forward || "target"][e];
41
41
  if (value !== void 0) outgoing[e] = value;
42
42
  }
43
+ if (outgoing.host === void 0 && typeof outgoing.hostname === "string") {
44
+ const bracketedHost = outgoing.hostname.includes(":") && !outgoing.hostname.startsWith("[") ? `[${outgoing.hostname}]` : outgoing.hostname;
45
+ outgoing.host = outgoing.port ? `${bracketedHost}:${outgoing.port}` : bracketedHost;
46
+ }
43
47
  outgoing.method = options.method || req.method;
44
48
  outgoing.headers = { ...req.headers };
45
49
  if (req.headers?.[":authority"]) outgoing.headers.host = req.headers[":authority"];
@@ -550,15 +554,15 @@ function _createProxyFn(type, server) {
550
554
  for (const pass of server._getPasses(type)) {
551
555
  let stop;
552
556
  try {
553
- stop = pass(req, res, requestOptions, server, head, (error) => {
557
+ stop = pass(req, res, requestOptions, server, head, (error, _req, _res, url) => {
554
558
  if (server.listenerCount("error") > 0) {
555
- server.emit("error", error, req, res);
559
+ server.emit("error", error, req, res, url);
556
560
  _resolve();
557
561
  } else _reject(error);
558
562
  });
559
563
  } catch (error) {
560
564
  if (server.listenerCount("error") > 0) {
561
- server.emit("error", error, req, res);
565
+ server.emit("error", error, req, res, requestOptions.target || requestOptions.forward);
562
566
  _resolve();
563
567
  } else _reject(error);
564
568
  break;
@@ -836,4 +840,4 @@ function _createHttpHeader(line, headers) {
836
840
  }
837
841
  return `${result}\r\n\r\n`;
838
842
  }
839
- export { proxyFetch as n, proxyUpgrade as r, createProxyServer as t };
843
+ export { createProxyServer, proxyFetch, proxyUpgrade };