Socket
Socket
Sign inDemoInstall

socket.io

Package Overview
Dependencies
Maintainers
2
Versions
157
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

socket.io - npm Package Compare versions

Comparing version 4.2.0 to 4.3.0

client-dist/socket.io.esm.min.js

14

CHANGELOG.md

@@ -0,1 +1,15 @@

# [4.3.0](https://github.com/socketio/socket.io/compare/4.2.0...4.3.0) (2021-10-14)
### Bug Fixes
* **typings:** add name field to cookie option ([#4099](https://github.com/socketio/socket.io/issues/4099)) ([033c5d3](https://github.com/socketio/socket.io/commit/033c5d399a2b985afad32c1e4b0c16d764e248cd))
* send volatile packets with binary attachments ([dc81fcf](https://github.com/socketio/socket.io/commit/dc81fcf461cfdbb5b34b1a5a96b84373754047d5))
### Features
* serve ESM bundle ([60edecb](https://github.com/socketio/socket.io/commit/60edecb3bd33801803cdcba0aefbafa381a2abb3))
# [4.2.0](https://github.com/socketio/socket.io/compare/4.1.3...4.2.0) (2021-08-30)

@@ -2,0 +16,0 @@

3

dist/client.d.ts

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

import type { Socket } from "./socket";
import type { Socket as RawSocket } from "engine.io";
interface WriteOptions {

@@ -15,3 +16,3 @@ compress?: boolean;

export declare class Client<ListenEvents extends EventsMap, EmitEvents extends EventsMap, ServerSideEvents extends EventsMap> {
readonly conn: any;
readonly conn: RawSocket;
private readonly id;

@@ -18,0 +19,0 @@ private readonly server;

@@ -161,7 +161,5 @@ "use strict";

: this.encoder.encode(packet);
for (const encodedPacket of encodedPackets) {
this.writeToEngine(encodedPacket, opts);
}
this.writeToEngine(encodedPackets, opts);
}
writeToEngine(encodedPacket, opts) {
writeToEngine(encodedPackets, opts) {
if (opts.volatile && !this.conn.transport.writable) {

@@ -171,3 +169,8 @@ debug("volatile packet is discarded since the transport is not currently writable");

}
this.conn.write(encodedPacket, opts);
const packets = Array.isArray(encodedPackets)
? encodedPackets
: [encodedPackets];
for (const encodedPacket of packets) {
this.conn.write(encodedPacket, opts);
}
}

@@ -174,0 +177,0 @@ /**

/// <reference types="node" />
import http = require("http");
import { ServerOptions as EngineOptions, AttachOptions } from "engine.io";
import { ExtendedError, Namespace, ServerReservedEventsMap } from "./namespace";

@@ -8,7 +9,4 @@ import { Adapter, Room, SocketId } from "socket.io-adapter";

import { Socket } from "./socket";
import type { CookieSerializeOptions } from "cookie";
import type { CorsOptions } from "cors";
import type { BroadcastOperator, RemoteSocket } from "./broadcast-operator";
import { EventsMap, DefaultEventsMap, EventParams, StrictEventEmitter, EventNames } from "./typed-events";
declare type Transport = "polling" | "websocket";
declare type ParentNspNameMatchFn = (name: string, auth: {

@@ -18,100 +16,5 @@ [key: string]: any;

declare type AdapterConstructor = typeof Adapter | ((nsp: Namespace) => Adapter);
interface EngineOptions {
interface ServerOptions extends EngineOptions, AttachOptions {
/**
* how many ms without a pong packet to consider the connection closed
* @default 20000
*/
pingTimeout: number;
/**
* how many ms before sending a new ping packet
* @default 25000
*/
pingInterval: number;
/**
* how many ms before an uncompleted transport upgrade is cancelled
* @default 10000
*/
upgradeTimeout: number;
/**
* how many bytes or characters a message can be, before closing the session (to avoid DoS).
* @default 1e5 (100 KB)
*/
maxHttpBufferSize: number;
/**
* A function that receives a given handshake or upgrade request as its first parameter,
* and can decide whether to continue or not. The second argument is a function that needs
* to be called with the decided information: fn(err, success), where success is a boolean
* value where false means that the request is rejected, and err is an error code.
*/
allowRequest: (req: http.IncomingMessage, fn: (err: string | null | undefined, success: boolean) => void) => void;
/**
* the low-level transports that are enabled
* @default ["polling", "websocket"]
*/
transports: Transport[];
/**
* whether to allow transport upgrades
* @default true
*/
allowUpgrades: boolean;
/**
* parameters of the WebSocket permessage-deflate extension (see ws module api docs). Set to false to disable.
* @default false
*/
perMessageDeflate: boolean | object;
/**
* parameters of the http compression for the polling transports (see zlib api docs). Set to false to disable.
* @default true
*/
httpCompression: boolean | object;
/**
* what WebSocket server implementation to use. Specified module must
* conform to the ws interface (see ws module api docs).
* An alternative c++ addon is also available by installing eiows module.
*
* @default `require("ws").Server`
*/
wsEngine: Function;
/**
* an optional packet which will be concatenated to the handshake packet emitted by Engine.IO.
*/
initialPacket: any;
/**
* configuration of the cookie that contains the client sid to send as part of handshake response headers. This cookie
* might be used for sticky-session. Defaults to not sending any cookie.
* @default false
*/
cookie: CookieSerializeOptions | boolean;
/**
* the options that will be forwarded to the cors module
*/
cors: CorsOptions;
/**
* whether to enable compatibility with Socket.IO v2 clients
* @default false
*/
allowEIO3: boolean;
}
interface AttachOptions {
/**
* name of the path to capture
* @default "/engine.io"
*/
path: string;
/**
* destroy unhandled upgrade requests
* @default true
*/
destroyUpgrade: boolean;
/**
* milliseconds after which unhandled requests are ended
* @default 1000
*/
destroyUpgradeTimeout: number;
}
interface EngineAttachOptions extends EngineOptions, AttachOptions {
}
interface ServerOptions extends EngineAttachOptions {
/**
* name of the path to capture
* @default "/socket.io"

@@ -118,0 +21,0 @@ */

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

const path = require("path");
const engine = require("engine.io");
const engine_io_1 = require("engine.io");
const client_1 = require("./client");

@@ -70,4 +70,5 @@ const events_1 = require("events");

this.opts = opts;
if (srv)
if (srv instanceof http.Server || typeof srv === "number") {
this.attach(srv);
}
}

@@ -121,3 +122,3 @@ serveClient(v) {

escapedPath +
"/socket\\.io(\\.min|\\.msgpack\\.min)?\\.js(\\.map)?(?:\\?|$)");
"/socket\\.io(\\.msgpack|\\.esm)?(\\.min)?\\.js(\\.map)?(?:\\?|$)");
return this;

@@ -195,3 +196,3 @@ }

debug("creating engine.io instance with opts %j", opts);
this.eio = engine.attach(srv, opts);
this.eio = (0, engine_io_1.attach)(srv, opts);
// attach static file serving

@@ -198,0 +199,0 @@ if (this._serveClient)

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

*/
get conn(): any;
get conn(): import("engine.io").Socket;
/**

@@ -313,0 +313,0 @@ * @public

{
"name": "socket.io",
"version": "4.2.0",
"version": "4.3.0",
"description": "node.js realtime framework server",

@@ -48,9 +48,6 @@ "keywords": [

"dependencies": {
"@types/cookie": "^0.4.1",
"@types/cors": "^2.8.12",
"@types/node": ">=10.0.0",
"accepts": "~1.3.4",
"base64id": "~2.0.0",
"debug": "~4.3.2",
"engine.io": "~5.2.0",
"engine.io": "~6.0.0",
"socket.io-adapter": "~2.3.2",

@@ -66,3 +63,3 @@ "socket.io-parser": "~4.0.4"

"rimraf": "^3.0.2",
"socket.io-client": "4.2.0",
"socket.io-client": "4.3.0",
"socket.io-client-v2": "npm:socket.io-client@^2.4.0",

@@ -69,0 +66,0 @@ "superagent": "^6.1.0",

@@ -25,3 +25,3 @@ # socket.io

- [Python](https://github.com/miguelgrinberg/python-socketio)
- [.Net](https://github.com/Quobject/SocketIoClientDotNet)
- [.NET](https://github.com/doghappy/socket.io-client-csharp)

@@ -28,0 +28,0 @@ Its main features are:

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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