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

@web/dev-server-core

Package Overview
Dependencies
Maintainers
7
Versions
85
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@web/dev-server-core - npm Package Compare versions

Comparing version 0.3.6 to 0.3.7

6

CHANGELOG.md
# @web/dev-server-core
## 0.3.7
### Patch Changes
- 1265c13e: Migrate websocket endpoint away from '/' to '/wds'. This allows end users to potentially proxy web sockets with out colliding with WebDevServer's websocket.
## 0.3.6

@@ -4,0 +10,0 @@

1

dist/web-sockets/WebSocketsManager.d.ts

@@ -6,2 +6,3 @@ /// <reference types="node" />

export declare const NAME_WEB_SOCKET_IMPORT = "/__web-dev-server__web-socket.js";
export declare const NAME_WEB_SOCKET_API = "wds";
export declare type WebSocketData = {

@@ -8,0 +9,0 @@ type: string;

8

dist/web-sockets/WebSocketsManager.js

@@ -6,6 +6,7 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.WebSocketsManager = exports.NAME_WEB_SOCKET_IMPORT = void 0;
exports.WebSocketsManager = exports.NAME_WEB_SOCKET_API = exports.NAME_WEB_SOCKET_IMPORT = void 0;
const ws_1 = __importDefault(require("ws"));
const EventEmitter_1 = require("./EventEmitter");
exports.NAME_WEB_SOCKET_IMPORT = '/__web-dev-server__web-socket.js';
exports.NAME_WEB_SOCKET_API = 'wds';
/**

@@ -20,3 +21,6 @@ * Manages web sockets. When the browser opens a web socket connection, the socket is stored

this.openSockets = new Set();
this.webSocketServer = new ws_1.default.Server({ noServer: true });
this.webSocketServer = new ws_1.default.Server({
noServer: true,
path: `/${exports.NAME_WEB_SOCKET_API}`,
});
this.webSocketServer.on('connection', webSocket => {

@@ -23,0 +27,0 @@ this.openSockets.add(webSocket);

@@ -41,3 +41,3 @@ "use strict";

'WebSocket' in window
? new WebSocket(\`ws\${location.protocol === 'https:' ? 's' : ''}://\${location.host}\`)
? new WebSocket(\`ws\${location.protocol === 'https:' ? 's' : ''}://\${location.host}/${WebSocketsManager_1.NAME_WEB_SOCKET_API}\`)
: null;

@@ -44,0 +44,0 @@ webSocketOpened = new Promise(resolve => {

{
"name": "@web/dev-server-core",
"version": "0.3.6",
"version": "0.3.7",
"publishConfig": {

@@ -5,0 +5,0 @@ "access": "public"

@@ -6,2 +6,3 @@ import { Server } from 'net';

export const NAME_WEB_SOCKET_IMPORT = '/__web-dev-server__web-socket.js';
export const NAME_WEB_SOCKET_API = 'wds';

@@ -26,3 +27,6 @@ export type WebSocketData = { type: string } & Record<string, unknown>;

this.webSocketServer = new WebSocket.Server({ noServer: true });
this.webSocketServer = new WebSocket.Server({
noServer: true,
path: `/${NAME_WEB_SOCKET_API}`,
});
this.webSocketServer.on('connection', webSocket => {

@@ -29,0 +33,0 @@ this.openSockets.add(webSocket);

import { Plugin } from '../plugins/Plugin';
import { NAME_WEB_SOCKET_IMPORT } from './WebSocketsManager';
import { NAME_WEB_SOCKET_IMPORT, NAME_WEB_SOCKET_API } from './WebSocketsManager';
import { appendToDocument, isHtmlFragment } from '@web/parse5-utils';

@@ -43,3 +43,3 @@

'WebSocket' in window
? new WebSocket(\`ws\${location.protocol === 'https:' ? 's' : ''}://\${location.host}\`)
? new WebSocket(\`ws\${location.protocol === 'https:' ? 's' : ''}://\${location.host}/${NAME_WEB_SOCKET_API}\`)
: null;

@@ -46,0 +46,0 @@ webSocketOpened = new Promise(resolve => {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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