env-runner
Advanced tools
@@ -33,3 +33,5 @@ import { resolveVirtualModules } from "./virtual-loader.mjs"; | ||
| if (!this.ready || !this._address) return; | ||
| await proxyUpgrade(this._address, context.node.req, context.node.socket, context.node.head); | ||
| try { | ||
| await proxyUpgrade(this._address, context.node.req, context.node.socket, context.node.head); | ||
| } catch {} | ||
| } | ||
@@ -36,0 +38,0 @@ onMessage(listener) { |
@@ -316,6 +316,8 @@ import { expandVirtualInvalidation, stripVirtualTypeScript, virtualModuleFormat } from "./virtual-loader.mjs"; | ||
| const address = new URL(mfUrl); | ||
| await proxyUpgrade({ | ||
| host: address.hostname, | ||
| port: Number(address.port) | ||
| }, context.node.req, context.node.socket, context.node.head); | ||
| try { | ||
| await proxyUpgrade({ | ||
| host: address.hostname, | ||
| port: Number(address.port) | ||
| }, context.node.req, context.node.socket, context.node.head); | ||
| } catch {} | ||
| } | ||
@@ -322,0 +324,0 @@ async #prepareVirtualModules() { |
@@ -21,7 +21,11 @@ import { BaseEnvRunner } from "../../_chunks/common-base-runner.mjs"; | ||
| if (!this.#entry || this.closed) return; | ||
| if (this.#entry.websocket) { | ||
| await (await this.#resolveWSAdapter()).handleUpgrade(context.node.req, context.node.socket, context.node.head); | ||
| return; | ||
| try { | ||
| if (this.#entry.websocket) { | ||
| await (await this.#resolveWSAdapter()).handleUpgrade(context.node.req, context.node.socket, context.node.head); | ||
| return; | ||
| } | ||
| this.#entry.upgrade?.(context); | ||
| } catch { | ||
| if (!context.node.socket.destroyed) context.node.socket.destroy(); | ||
| } | ||
| this.#entry.upgrade?.(context); | ||
| } | ||
@@ -28,0 +32,0 @@ sendMessage(message) { |
+1
-1
| { | ||
| "name": "env-runner", | ||
| "version": "0.1.12", | ||
| "version": "0.1.13", | ||
| "description": "Generic environment runner for JavaScript runtimes.", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
188373
0.08%2885
0.28%