@encharm/cws
Advanced tools
Comparing version 4.0.2 to 4.1.0
@@ -0,1 +1,4 @@ | ||
## Released 4.1.0 | ||
* Add support for socket.bufferedAmount | ||
## Released 4.0.2 | ||
@@ -2,0 +5,0 @@ * Add support for Node 16 |
@@ -16,2 +16,3 @@ /// <reference types="node" /> | ||
constructor(url: string, options?: any); | ||
get bufferedAmount(): number; | ||
get _socket(): SocketAddress; | ||
@@ -18,0 +19,0 @@ get readyState(): number; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.WebSocket = void 0; | ||
const server_1 = require("./server"); | ||
@@ -30,2 +31,5 @@ const shared_1 = require("./shared"); | ||
} | ||
get bufferedAmount() { | ||
return this.external ? shared_1.native.getBufferedAmount(this.external) : 0; | ||
} | ||
get _socket() { | ||
@@ -32,0 +36,0 @@ const address = this.external ? shared_1.native.getAddress(this.external) : new Array(3); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.secureProtocol = void 0; | ||
var client_1 = require("./client"); | ||
exports.WebSocket = client_1.WebSocket; | ||
Object.defineProperty(exports, "WebSocket", { enumerable: true, get: function () { return client_1.WebSocket; } }); | ||
var server_1 = require("./server"); | ||
exports.WebSocketServer = server_1.WebSocketServer; | ||
Object.defineProperty(exports, "WebSocketServer", { enumerable: true, get: function () { return server_1.WebSocketServer; } }); | ||
exports.secureProtocol = 'TLSv1_2_method'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.WebSocketServer = void 0; | ||
const HTTP = require("http"); | ||
@@ -4,0 +5,0 @@ const shared_1 = require("./shared"); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.setupNative = exports.native = exports.DEFAULT_PAYLOAD_LIMIT = exports.SLIDING_DEFLATE_WINDOW = exports.PERMESSAGE_DEFLATE = exports.APP_PING_CODE = exports.OPCODE_BINARY = exports.OPCODE_PING = exports.OPCODE_TEXT = exports.noop = void 0; | ||
const client_1 = require("./client"); | ||
@@ -4,0 +5,0 @@ exports.noop = () => { }; |
{ | ||
"name": "@encharm/cws", | ||
"version": "4.0.2", | ||
"version": "4.1.0", | ||
"main": "./dist/index.js", | ||
@@ -5,0 +5,0 @@ "types": "./dist/index.d.ts", |
@@ -9,3 +9,3 @@ <h1 align="center">encharm/cWS</h1> | ||
* This repository is a fork of [ClusterWS/cWS](https://github.com/ClusterWS/cWS) | ||
* Prior, this repository was a fork of [uWebSockets v0.14](https://github.com/uNetworking/uWebSockets/tree/v0.14) therefore has two licence [MIT](https://github.com/ClusterWS/uWS/blob/master/LICENSE) and [ZLIB](https://github.com/ClusterWS/uWS/blob/master/src/LICENSE) | ||
* Prior, this repository was a fork of [uWebSockets v0.14](https://github.com/uNetworking/uWebSockets/tree/v0.14) therefore has two licence [MIT](https://github.com/encharm/cWS/blob/master/LICENSE) and [ZLIB](https://github.com/encharm/cWS/blob/master/src/LICENSE) | ||
@@ -18,3 +18,4 @@ ## Supported Node Versions (SSL) | ||
|--------------|----------|---------|------------------|-----------|---------|----------| | ||
| 4.0.0 | >=10.0 | X | >=12.16 | >=13.9 | >=14.5 | >= 16.11 | | ||
| 4.x.x | >=10.0 | X | >=12.16 | >=13.9 | >=14.5 | >= 16.11 | | ||
| *The versions below are available via @clusterws/cws* | | ||
| 3.0.0 | >=10.0 | X | >=12.16 | >=13.9 | >=14.5 | X | | ||
@@ -141,2 +142,8 @@ | 2.0.0 | >=10.0 | X | >=12.16 | >=13.9 | X | X | | ||
To find out number of buffered (and not yet sent) bytes: | ||
```js | ||
socket.bufferedAmount; | ||
// useful for implementing back-pressure | ||
``` | ||
To get addresses use `_socket` getter: | ||
@@ -143,0 +150,0 @@ ```js |
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
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
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
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
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
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
13915944
453
327