@nx.js/ws 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/package.json +7 -7
- package/dist/websocket.d.ts +0 -46
- package/dist/websocket.js +0 -167
- package/dist/websocket.js.map +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Nathan Rajlich
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx.js/ws",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "WebSocket server for nx.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -27,10 +27,6 @@
|
|
|
27
27
|
]
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
|
-
"scripts": {
|
|
31
|
-
"build": "tsc",
|
|
32
|
-
"docs": "typedoc && ../../type-aliases-meta.sh"
|
|
33
|
-
},
|
|
34
30
|
"files": [
|
|
35
31
|
"dist"
|
|
36
32
|
],
|
|
@@ -45,5 +41,9 @@
|
|
|
45
41
|
"ws"
|
|
46
42
|
],
|
|
47
43
|
"author": "Nathan Rajlich <n@n8.io>",
|
|
48
|
-
"license": "MIT"
|
|
49
|
-
|
|
44
|
+
"license": "MIT",
|
|
45
|
+
"scripts": {
|
|
46
|
+
"build": "tsc",
|
|
47
|
+
"docs": "typedoc && ../../type-aliases-meta.sh"
|
|
48
|
+
}
|
|
49
|
+
}
|
package/dist/websocket.d.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
export interface WebSocketEventMap {
|
|
2
|
-
open: Event;
|
|
3
|
-
message: MessageEvent;
|
|
4
|
-
close: CloseEvent;
|
|
5
|
-
error: Event;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Server-side WebSocket connection.
|
|
9
|
-
*
|
|
10
|
-
* Uses the Web `EventTarget` API (not Node.js `EventEmitter`).
|
|
11
|
-
* Server frames are NOT masked per RFC 6455.
|
|
12
|
-
*/
|
|
13
|
-
export declare class ServerWebSocket extends EventTarget {
|
|
14
|
-
#private;
|
|
15
|
-
static readonly CONNECTING = 0;
|
|
16
|
-
static readonly OPEN = 1;
|
|
17
|
-
static readonly CLOSING = 2;
|
|
18
|
-
static readonly CLOSED = 3;
|
|
19
|
-
readonly CONNECTING = 0;
|
|
20
|
-
readonly OPEN = 1;
|
|
21
|
-
readonly CLOSING = 2;
|
|
22
|
-
readonly CLOSED = 3;
|
|
23
|
-
/** The URL of the connection (from the HTTP upgrade request). */
|
|
24
|
-
readonly url: string;
|
|
25
|
-
/** The protocol negotiated during the handshake. */
|
|
26
|
-
readonly protocol: string;
|
|
27
|
-
/** The extensions negotiated during the handshake. */
|
|
28
|
-
readonly extensions: string;
|
|
29
|
-
constructor(writer: WritableStreamDefaultWriter<Uint8Array>, url: string, protocol?: string, extensions?: string);
|
|
30
|
-
get readyState(): number;
|
|
31
|
-
get bufferedAmount(): number;
|
|
32
|
-
get binaryType(): BinaryType;
|
|
33
|
-
set binaryType(value: BinaryType);
|
|
34
|
-
/** @internal Mark the socket as open and dispatch the `open` event. */
|
|
35
|
-
_open(): void;
|
|
36
|
-
/**
|
|
37
|
-
* Send data over the WebSocket connection.
|
|
38
|
-
*/
|
|
39
|
-
send(data: string | ArrayBufferLike | Blob | ArrayBufferView): void;
|
|
40
|
-
/**
|
|
41
|
-
* Initiate the closing handshake.
|
|
42
|
-
*/
|
|
43
|
-
close(code?: number, reason?: string): void;
|
|
44
|
-
/** @internal Process an incoming frame. */
|
|
45
|
-
_handleFrame(opcode: number, fin: boolean, payload: Uint8Array): void;
|
|
46
|
-
}
|
package/dist/websocket.js
DELETED
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
import { buildFrame, CLOSED, CLOSING, CONNECTING, decodeClosePayload, encodeClosePayload, OP_BINARY, OP_CLOSE, OP_CONTINUATION, OP_PING, OP_PONG, OP_TEXT, OPEN, } from './frame';
|
|
2
|
-
const encoder = new TextEncoder();
|
|
3
|
-
const decoder = new TextDecoder();
|
|
4
|
-
/**
|
|
5
|
-
* Server-side WebSocket connection.
|
|
6
|
-
*
|
|
7
|
-
* Uses the Web `EventTarget` API (not Node.js `EventEmitter`).
|
|
8
|
-
* Server frames are NOT masked per RFC 6455.
|
|
9
|
-
*/
|
|
10
|
-
export class ServerWebSocket extends EventTarget {
|
|
11
|
-
static CONNECTING = CONNECTING;
|
|
12
|
-
static OPEN = OPEN;
|
|
13
|
-
static CLOSING = CLOSING;
|
|
14
|
-
static CLOSED = CLOSED;
|
|
15
|
-
CONNECTING = CONNECTING;
|
|
16
|
-
OPEN = OPEN;
|
|
17
|
-
CLOSING = CLOSING;
|
|
18
|
-
CLOSED = CLOSED;
|
|
19
|
-
#readyState = CONNECTING;
|
|
20
|
-
#writer;
|
|
21
|
-
#binaryType = 'blob';
|
|
22
|
-
#bufferedAmount = 0;
|
|
23
|
-
#fragments = [];
|
|
24
|
-
#fragmentOpcode = null;
|
|
25
|
-
/** The URL of the connection (from the HTTP upgrade request). */
|
|
26
|
-
url;
|
|
27
|
-
/** The protocol negotiated during the handshake. */
|
|
28
|
-
protocol;
|
|
29
|
-
/** The extensions negotiated during the handshake. */
|
|
30
|
-
extensions;
|
|
31
|
-
constructor(writer, url, protocol = '', extensions = '') {
|
|
32
|
-
super();
|
|
33
|
-
this.#writer = writer;
|
|
34
|
-
this.url = url;
|
|
35
|
-
this.protocol = protocol;
|
|
36
|
-
this.extensions = extensions;
|
|
37
|
-
}
|
|
38
|
-
get readyState() {
|
|
39
|
-
return this.#readyState;
|
|
40
|
-
}
|
|
41
|
-
get bufferedAmount() {
|
|
42
|
-
return this.#bufferedAmount;
|
|
43
|
-
}
|
|
44
|
-
get binaryType() {
|
|
45
|
-
return this.#binaryType;
|
|
46
|
-
}
|
|
47
|
-
set binaryType(value) {
|
|
48
|
-
if (value !== 'blob' && value !== 'arraybuffer') {
|
|
49
|
-
throw new SyntaxError(`Invalid binaryType: ${value}`);
|
|
50
|
-
}
|
|
51
|
-
this.#binaryType = value;
|
|
52
|
-
}
|
|
53
|
-
/** @internal Mark the socket as open and dispatch the `open` event. */
|
|
54
|
-
_open() {
|
|
55
|
-
this.#readyState = OPEN;
|
|
56
|
-
this.dispatchEvent(new Event('open'));
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Send data over the WebSocket connection.
|
|
60
|
-
*/
|
|
61
|
-
send(data) {
|
|
62
|
-
if (this.#readyState !== OPEN) {
|
|
63
|
-
throw new DOMException('WebSocket is not open', 'InvalidStateError');
|
|
64
|
-
}
|
|
65
|
-
let payload;
|
|
66
|
-
let opcode;
|
|
67
|
-
if (typeof data === 'string') {
|
|
68
|
-
payload = encoder.encode(data);
|
|
69
|
-
opcode = OP_TEXT;
|
|
70
|
-
}
|
|
71
|
-
else if (data instanceof ArrayBuffer ||
|
|
72
|
-
data instanceof SharedArrayBuffer) {
|
|
73
|
-
payload = new Uint8Array(data);
|
|
74
|
-
opcode = OP_BINARY;
|
|
75
|
-
}
|
|
76
|
-
else if (ArrayBuffer.isView(data)) {
|
|
77
|
-
payload = new Uint8Array(data.buffer, data.byteOffset, data.byteLength);
|
|
78
|
-
opcode = OP_BINARY;
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
throw new TypeError('Blob send is not supported; convert to ArrayBuffer first');
|
|
82
|
-
}
|
|
83
|
-
// Server frames are NOT masked
|
|
84
|
-
const frame = buildFrame(opcode, payload, false);
|
|
85
|
-
this.#bufferedAmount += frame.length;
|
|
86
|
-
this.#writer.write(frame).then(() => {
|
|
87
|
-
this.#bufferedAmount -= frame.length;
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Initiate the closing handshake.
|
|
92
|
-
*/
|
|
93
|
-
close(code, reason) {
|
|
94
|
-
if (this.#readyState === CLOSING || this.#readyState === CLOSED) {
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
this.#readyState = CLOSING;
|
|
98
|
-
const payload = encodeClosePayload(code, reason);
|
|
99
|
-
const frame = buildFrame(OP_CLOSE, payload, false);
|
|
100
|
-
this.#writer.write(frame);
|
|
101
|
-
}
|
|
102
|
-
/** @internal Process an incoming frame. */
|
|
103
|
-
_handleFrame(opcode, fin, payload) {
|
|
104
|
-
switch (opcode) {
|
|
105
|
-
case OP_TEXT:
|
|
106
|
-
case OP_BINARY: {
|
|
107
|
-
if (!fin) {
|
|
108
|
-
this.#fragmentOpcode = opcode;
|
|
109
|
-
this.#fragments.push(payload);
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
this.#dispatchMessage(opcode, payload);
|
|
113
|
-
break;
|
|
114
|
-
}
|
|
115
|
-
case OP_CONTINUATION: {
|
|
116
|
-
this.#fragments.push(payload);
|
|
117
|
-
if (fin) {
|
|
118
|
-
const totalLen = this.#fragments.reduce((s, f) => s + f.length, 0);
|
|
119
|
-
const assembled = new Uint8Array(totalLen);
|
|
120
|
-
let offset = 0;
|
|
121
|
-
for (const frag of this.#fragments) {
|
|
122
|
-
assembled.set(frag, offset);
|
|
123
|
-
offset += frag.length;
|
|
124
|
-
}
|
|
125
|
-
const msgOpcode = this.#fragmentOpcode;
|
|
126
|
-
this.#fragments = [];
|
|
127
|
-
this.#fragmentOpcode = null;
|
|
128
|
-
this.#dispatchMessage(msgOpcode, assembled);
|
|
129
|
-
}
|
|
130
|
-
break;
|
|
131
|
-
}
|
|
132
|
-
case OP_PING: {
|
|
133
|
-
const pong = buildFrame(OP_PONG, payload, false);
|
|
134
|
-
this.#writer.write(pong);
|
|
135
|
-
break;
|
|
136
|
-
}
|
|
137
|
-
case OP_PONG:
|
|
138
|
-
break;
|
|
139
|
-
case OP_CLOSE: {
|
|
140
|
-
const { code, reason } = decodeClosePayload(payload);
|
|
141
|
-
if (this.#readyState === OPEN) {
|
|
142
|
-
const closeFrame = buildFrame(OP_CLOSE, payload, false);
|
|
143
|
-
this.#writer.write(closeFrame);
|
|
144
|
-
}
|
|
145
|
-
this.#readyState = CLOSED;
|
|
146
|
-
this.#writer.close().catch(() => { });
|
|
147
|
-
this.dispatchEvent(new CloseEvent('close', {
|
|
148
|
-
code,
|
|
149
|
-
reason,
|
|
150
|
-
wasClean: true,
|
|
151
|
-
}));
|
|
152
|
-
break;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
#dispatchMessage(opcode, payload) {
|
|
157
|
-
let data;
|
|
158
|
-
if (opcode === OP_TEXT) {
|
|
159
|
-
data = decoder.decode(payload);
|
|
160
|
-
}
|
|
161
|
-
else {
|
|
162
|
-
data = payload.buffer.slice(payload.byteOffset, payload.byteOffset + payload.byteLength);
|
|
163
|
-
}
|
|
164
|
-
this.dispatchEvent(new MessageEvent('message', { data }));
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
//# sourceMappingURL=websocket.js.map
|
package/dist/websocket.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"websocket.js","sourceRoot":"","sources":["../src/websocket.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,UAAU,EACV,MAAM,EACN,OAAO,EACP,UAAU,EACV,kBAAkB,EAClB,kBAAkB,EAClB,SAAS,EACT,QAAQ,EACR,eAAe,EACf,OAAO,EACP,OAAO,EACP,OAAO,EACP,IAAI,GACJ,MAAM,SAAS,CAAC;AAEjB,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;AAClC,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;AASlC;;;;;GAKG;AACH,MAAM,OAAO,eAAgB,SAAQ,WAAW;IAC/C,MAAM,CAAU,UAAU,GAAG,UAAU,CAAC;IACxC,MAAM,CAAU,IAAI,GAAG,IAAI,CAAC;IAC5B,MAAM,CAAU,OAAO,GAAG,OAAO,CAAC;IAClC,MAAM,CAAU,MAAM,GAAG,MAAM,CAAC;IAEvB,UAAU,GAAG,UAAU,CAAC;IACxB,IAAI,GAAG,IAAI,CAAC;IACZ,OAAO,GAAG,OAAO,CAAC;IAClB,MAAM,GAAG,MAAM,CAAC;IAEzB,WAAW,GAAG,UAAU,CAAC;IACzB,OAAO,CAA0C;IACjD,WAAW,GAAe,MAAM,CAAC;IACjC,eAAe,GAAG,CAAC,CAAC;IACpB,UAAU,GAAiB,EAAE,CAAC;IAC9B,eAAe,GAAkB,IAAI,CAAC;IAEtC,iEAAiE;IACxD,GAAG,CAAS;IACrB,oDAAoD;IAC3C,QAAQ,CAAS;IAC1B,sDAAsD;IAC7C,UAAU,CAAS;IAE5B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