Socket
Socket
Sign inDemoInstall

ws

Package Overview
Dependencies
Maintainers
4
Versions
169
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ws - npm Package Compare versions

Comparing version 8.8.1 to 8.9.0

30

lib/websocket.js

@@ -680,16 +680,16 @@ /* eslint no-unused-vars: ["error", { "varsIgnorePattern": "^Readable$" }] */

const isSecure = parsedUrl.protocol === 'wss:';
const isUnixSocket = parsedUrl.protocol === 'ws+unix:';
let invalidURLMessage;
const isIpcUrl = parsedUrl.protocol === 'ws+unix:';
let invalidUrlMessage;
if (parsedUrl.protocol !== 'ws:' && !isSecure && !isUnixSocket) {
invalidURLMessage =
if (parsedUrl.protocol !== 'ws:' && !isSecure && !isIpcUrl) {
invalidUrlMessage =
'The URL\'s protocol must be one of "ws:", "wss:", or "ws+unix:"';
} else if (isUnixSocket && !parsedUrl.pathname) {
invalidURLMessage = "The URL's pathname is empty";
} else if (isIpcUrl && !parsedUrl.pathname) {
invalidUrlMessage = "The URL's pathname is empty";
} else if (parsedUrl.hash) {
invalidURLMessage = 'The URL contains a fragment identifier';
invalidUrlMessage = 'The URL contains a fragment identifier';
}
if (invalidURLMessage) {
const err = new SyntaxError(invalidURLMessage);
if (invalidUrlMessage) {
const err = new SyntaxError(invalidUrlMessage);

@@ -764,3 +764,3 @@ if (websocket._redirects === 0) {

if (isUnixSocket) {
if (isIpcUrl) {
const parts = opts.path.split(':');

@@ -776,5 +776,5 @@

if (websocket._redirects === 0) {
websocket._originalUnixSocket = isUnixSocket;
websocket._originalIpc = isIpcUrl;
websocket._originalSecure = isSecure;
websocket._originalHostOrSocketPath = isUnixSocket
websocket._originalHostOrSocketPath = isIpcUrl
? opts.socketPath

@@ -797,7 +797,7 @@ : parsedUrl.host;

} else if (websocket.listenerCount('redirect') === 0) {
const isSameHost = isUnixSocket
? websocket._originalUnixSocket
const isSameHost = isIpcUrl
? websocket._originalIpc
? opts.socketPath === websocket._originalHostOrSocketPath
: false
: websocket._originalUnixSocket
: websocket._originalIpc
? false

@@ -804,0 +804,0 @@ : parsedUrl.host === websocket._originalHostOrSocketPath;

{
"name": "ws",
"version": "8.8.1",
"version": "8.9.0",
"description": "Simple to use, blazing fast and thoroughly tested websocket client and server for Node.js",

@@ -5,0 +5,0 @@ "keywords": [

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