@web/dev-server-core
Advanced tools
Comparing version 0.3.6 to 0.3.7
# @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 @@ |
@@ -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; |
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
287843
5422