Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@miniflare/web-sockets

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@miniflare/web-sockets - npm Package Compare versions

Comparing version 2.0.0-rc.4 to 2.0.0-rc.5

2

dist/src/index.d.ts
import { InputGatedEventTarget } from '@miniflare/shared';
import { kWrapListener } from '@miniflare/shared';
import { Plugin } from '@miniflare/shared';

@@ -55,2 +56,3 @@ import { PluginContext } from '@miniflare/shared';

[kClosed]: boolean;
protected [kWrapListener]<Type extends keyof WebSocketEventMap>(listener: (event: WebSocketEventMap[Type]) => void): (event: WebSocketEventMap[Type]) => void;
accept(): void;

@@ -57,0 +59,0 @@ send(message: ArrayBuffer | string): void;

@@ -40,2 +40,3 @@ var __create = Object.create;

var import_core = __toModule(require("@miniflare/core"));
var import_shared3 = __toModule(require("@miniflare/shared"));
var import_ws2 = __toModule(require("ws"));

@@ -86,2 +87,17 @@

[kClosed] = false;
[import_shared.kWrapListener](listener) {
const wrappedListener = super[import_shared.kWrapListener](listener);
const addListenerCtx = (0, import_shared.getRequestContext)();
return (event) => {
if (addListenerCtx?.durableObject || addListenerCtx === void 0) {
const ctx = new import_shared.RequestContext({
requestDepth: addListenerCtx?.requestDepth,
pipelineDepth: addListenerCtx?.pipelineDepth
});
ctx.runWith(() => wrappedListener(event));
} else {
addListenerCtx.runWith(() => wrappedListener(event));
}
};
}
accept() {

@@ -213,2 +229,3 @@ if (this[kCoupled]) {

if (request.method === "GET" && request.headers.get("upgrade") === "websocket") {
(0, import_shared3.getRequestContext)()?.incrementSubrequests();
const url = new import_url.URL(request.url);

@@ -245,5 +262,5 @@ if (url.protocol !== "http:" && url.protocol !== "https:") {

var import_core2 = __toModule(require("@miniflare/core"));
var import_shared3 = __toModule(require("@miniflare/shared"));
var import_shared4 = __toModule(require("@miniflare/shared"));
var constructError = "Failed to construct 'WebSocket': the constructor is not implemented.";
var WebSocketPlugin = class extends import_shared3.Plugin {
var WebSocketPlugin = class extends import_shared4.Plugin {
#webSockets = new Set();

@@ -253,3 +270,3 @@ #upgradingFetch;

super(ctx);
this.#upgradingFetch = (0, import_core2.createCompatFetch)(ctx.log, ctx.compat, upgradingFetch);
this.#upgradingFetch = (0, import_core2.createCompatFetch)(ctx, upgradingFetch);
}

@@ -256,0 +273,0 @@ setup() {

8

package.json
{
"name": "@miniflare/web-sockets",
"version": "2.0.0-rc.4",
"version": "2.0.0-rc.5",
"description": "WebSocket module for Miniflare: a fun, full-featured, fully-local simulator for Cloudflare Workers",

@@ -38,4 +38,4 @@ "keywords": [

"dependencies": {
"@miniflare/core": "2.0.0-rc.4",
"@miniflare/shared": "2.0.0-rc.4",
"@miniflare/core": "2.0.0-rc.5",
"@miniflare/shared": "2.0.0-rc.5",
"ws": "^8.2.2",

@@ -45,5 +45,5 @@ "undici": "^4.11.1"

"devDependencies": {
"@miniflare/shared-test": "2.0.0-rc.4",
"@miniflare/shared-test": "2.0.0-rc.5",
"@types/ws": "^8.2.0"
}
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc