uwebsockets 2.2.2 → 3.0.1
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/.github/workflows/c-cpp.yml +11 -11
- package/ESM_wrapper.mjs +53 -0
- package/README.md +5 -5
- package/docs/generated/enums/ListenOptions.html +6 -6
- package/docs/generated/functions/App.html +4 -4
- package/docs/generated/functions/SSLApp.html +4 -4
- package/docs/generated/functions/getParts.html +4 -4
- package/docs/generated/functions/us_listen_socket_close.html +4 -4
- package/docs/generated/functions/us_socket_local_port.html +4 -4
- package/docs/generated/index.html +3 -3
- package/docs/generated/interfaces/AppOptions.html +11 -11
- package/docs/generated/interfaces/HttpRequest.html +13 -13
- package/docs/generated/interfaces/HttpResponse.html +22 -22
- package/docs/generated/interfaces/MultipartField.html +8 -8
- package/docs/generated/interfaces/TemplatedApp.html +23 -23
- package/docs/generated/interfaces/WebSocket.html +18 -18
- package/docs/generated/interfaces/WebSocketBehavior.html +19 -19
- package/docs/generated/interfaces/us_listen_socket.html +4 -4
- package/docs/generated/interfaces/us_socket.html +4 -4
- package/docs/generated/interfaces/us_socket_context_t.html +4 -4
- package/docs/generated/types/CompressOptions.html +4 -4
- package/docs/generated/types/RecognizedString.html +4 -4
- package/docs/generated/variables/DEDICATED_COMPRESSOR_128KB.html +4 -4
- package/docs/generated/variables/DEDICATED_COMPRESSOR_16KB.html +4 -4
- package/docs/generated/variables/DEDICATED_COMPRESSOR_256KB.html +4 -4
- package/docs/generated/variables/DEDICATED_COMPRESSOR_32KB.html +4 -4
- package/docs/generated/variables/DEDICATED_COMPRESSOR_3KB.html +4 -4
- package/docs/generated/variables/DEDICATED_COMPRESSOR_4KB.html +4 -4
- package/docs/generated/variables/DEDICATED_COMPRESSOR_64KB.html +4 -4
- package/docs/generated/variables/DEDICATED_COMPRESSOR_8KB.html +4 -4
- package/docs/generated/variables/DEDICATED_DECOMPRESSOR.html +4 -4
- package/docs/generated/variables/DEDICATED_DECOMPRESSOR_16KB.html +4 -4
- package/docs/generated/variables/DEDICATED_DECOMPRESSOR_1KB.html +4 -4
- package/docs/generated/variables/DEDICATED_DECOMPRESSOR_2KB.html +4 -4
- package/docs/generated/variables/DEDICATED_DECOMPRESSOR_32KB.html +4 -4
- package/docs/generated/variables/DEDICATED_DECOMPRESSOR_4KB.html +4 -4
- package/docs/generated/variables/DEDICATED_DECOMPRESSOR_512B.html +4 -4
- package/docs/generated/variables/DEDICATED_DECOMPRESSOR_8KB.html +4 -4
- package/docs/generated/variables/DISABLED.html +4 -4
- package/docs/generated/variables/SHARED_COMPRESSOR.html +4 -4
- package/docs/generated/variables/SHARED_DECOMPRESSOR.html +4 -4
- package/docs/tsconfig.json +9 -9
- package/examples/SlowReceiver.js +41 -38
- package/index.d.ts +106 -69
- package/logo.svg +1 -0
- package/package.json +27 -4
- package/source_commit +1 -1
- package/tests/Hammer.js +152 -149
- package/tests/fuzzingclient.json +26 -26
- package/uws.js +2 -2
- package/uws_darwin_arm64_108.node +0 -0
- package/uws_darwin_arm64_115.node +0 -0
- package/uws_darwin_arm64_120.node +0 -0
- package/uws_darwin_arm64_93.node +0 -0
- package/uws_darwin_x64_108.node +0 -0
- package/uws_darwin_x64_115.node +0 -0
- package/uws_darwin_x64_120.node +0 -0
- package/uws_darwin_x64_93.node +0 -0
- package/uws_linux_arm64_108.node +0 -0
- package/uws_linux_arm64_115.node +0 -0
- package/uws_linux_arm64_120.node +0 -0
- package/uws_linux_arm64_93.node +0 -0
- package/uws_linux_arm_108.node +0 -0
- package/uws_linux_arm_115.node +0 -0
- package/uws_linux_arm_120.node +0 -0
- package/uws_linux_arm_93.node +0 -0
- package/uws_linux_x64_108.node +0 -0
- package/uws_linux_x64_115.node +0 -0
- package/uws_linux_x64_120.node +0 -0
- package/uws_linux_x64_93.node +0 -0
- package/uws_win32_x64_108.node +0 -0
- package/uws_win32_x64_115.node +0 -0
- package/uws_win32_x64_120.node +0 -0
- package/uws_win32_x64_93.node +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>SHARED_DECOMPRESSOR |
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>SHARED_DECOMPRESSOR | uwebsockets v20.16.0 documentation</title><meta name="description" content="Documentation for uwebsockets v20.16.0 documentation"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"</script><header class="tsd-page-toolbar">
|
|
2
2
|
<div class="tsd-toolbar-contents container">
|
|
3
3
|
<div class="table-cell" id="tsd-search" data-base="..">
|
|
4
4
|
<div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M15.7824 13.833L12.6666 10.7177C12.5259 10.5771 12.3353 10.499 12.1353 10.499H11.6259C12.4884 9.39596 13.001 8.00859 13.001 6.49937C13.001 2.90909 10.0914 0 6.50048 0C2.90959 0 0 2.90909 0 6.49937C0 10.0896 2.90959 12.9987 6.50048 12.9987C8.00996 12.9987 9.39756 12.4863 10.5008 11.6239V12.1332C10.5008 12.3332 10.5789 12.5238 10.7195 12.6644L13.8354 15.7797C14.1292 16.0734 14.6042 16.0734 14.8948 15.7797L15.7793 14.8954C16.0731 14.6017 16.0731 14.1267 15.7824 13.833ZM6.50048 10.499C4.29094 10.499 2.50018 8.71165 2.50018 6.49937C2.50018 4.29021 4.28781 2.49976 6.50048 2.49976C8.71001 2.49976 10.5008 4.28708 10.5008 6.49937C10.5008 8.70852 8.71314 10.499 6.50048 10.499Z" fill="var(--color-text)"></path></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div>
|
|
@@ -6,20 +6,20 @@
|
|
|
6
6
|
<div id="tsd-toolbar-links"></div></div>
|
|
7
7
|
<ul class="results">
|
|
8
8
|
<li class="state loading">Preparing search index...</li>
|
|
9
|
-
<li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">
|
|
9
|
+
<li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">uwebsockets v20.16.0 documentation</a></div>
|
|
10
10
|
<div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><rect x="1" y="3" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="7" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="11" width="14" height="2" fill="var(--color-text)"></rect></svg></a></div></div></header>
|
|
11
11
|
<div class="container container-main">
|
|
12
12
|
<div class="col-8 col-content">
|
|
13
13
|
<div class="tsd-page-title">
|
|
14
14
|
<ul class="tsd-breadcrumb">
|
|
15
|
-
<li><a href="../index.html">
|
|
15
|
+
<li><a href="../index.html">uwebsockets v20.16.0 documentation</a></li>
|
|
16
16
|
<li><a href="SHARED_DECOMPRESSOR.html">SHARED_DECOMPRESSOR</a></li></ul>
|
|
17
17
|
<h1>Variable SHARED_DECOMPRESSOR</h1></div>
|
|
18
18
|
<div class="tsd-signature">SHARED_<wbr/>DECOMPRESSOR<span class="tsd-signature-symbol">:</span> <a href="../types/CompressOptions.html" class="tsd-signature-type" data-tsd-kind="Type alias">CompressOptions</a></div>
|
|
19
19
|
<div class="tsd-comment tsd-typography"><p>Zero memory overhead decompression.</p>
|
|
20
20
|
</div><aside class="tsd-sources">
|
|
21
21
|
<ul>
|
|
22
|
-
<li>Defined in <a href="https://github.com/uNetworking/
|
|
22
|
+
<li>Defined in <a href="https://github.com/uNetworking/uwebsockets/blob/master/docs/index.d.ts#L353">index.d.ts:353</a></li></ul></aside></div>
|
|
23
23
|
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
|
24
24
|
<div class="tsd-navigation settings">
|
|
25
25
|
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
|
package/docs/tsconfig.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
"files": ["index.d.ts"],
|
|
3
|
+
"typedocOptions": {
|
|
4
|
+
"name": "uwebsockets v20.23.0 documentation",
|
|
5
|
+
"entryPoints": ["index.d.ts"],
|
|
6
|
+
"out": "generated",
|
|
7
|
+
"excludeExternals": true,
|
|
8
|
+
"readme": "none",
|
|
9
|
+
"gitRevision": "master"
|
|
10
|
+
}
|
|
11
11
|
}
|
package/examples/SlowReceiver.js
CHANGED
|
@@ -1,39 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const uWS = require('uWebSockets.js');
|
|
1
|
+
const uWS = require("uwebsockets");
|
|
4
2
|
const port = 9001;
|
|
5
3
|
|
|
6
|
-
const wsc = require(
|
|
7
|
-
|
|
8
|
-
const app = uWS
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
ws
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
4
|
+
const wsc = require("ws");
|
|
5
|
+
|
|
6
|
+
const app = uWS
|
|
7
|
+
.App()
|
|
8
|
+
.ws("/*", {
|
|
9
|
+
/* Options */
|
|
10
|
+
maxPayloadLength: 16 * 1024 * 1024,
|
|
11
|
+
idleTimeout: 10,
|
|
12
|
+
maxBackpressure: 1024,
|
|
13
|
+
closeOnBackpressureLimit: true /* Enable or disable as needed */,
|
|
14
|
+
|
|
15
|
+
/* Handlers */
|
|
16
|
+
open: (ws) => {
|
|
17
|
+
console.log("Client connected");
|
|
18
|
+
ws.subscribe("clock_feed");
|
|
19
|
+
|
|
20
|
+
/* Disable closeOnBackpressureLimit and see this lie around 1024 */
|
|
21
|
+
ws.clock = setInterval(() => {
|
|
22
|
+
console.log(
|
|
23
|
+
"Connected socket has " + ws.getBufferedAmount() + " bytes buffered"
|
|
24
|
+
);
|
|
25
|
+
}, 1000);
|
|
26
|
+
},
|
|
27
|
+
close: (ws, code, message) => {
|
|
28
|
+
clearInterval(ws.clock);
|
|
29
|
+
console.log("Client disconnected: " + code + ", " + message);
|
|
30
|
+
/* The library guarantees proper unsubscription at close */
|
|
31
|
+
},
|
|
32
|
+
})
|
|
33
|
+
.listen(port, (listenSocket) => {
|
|
34
|
+
if (listenSocket) {
|
|
35
|
+
console.log("Listening to port " + port);
|
|
36
|
+
} else {
|
|
37
|
+
console.log("Failed to listen to port " + port);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
37
40
|
|
|
38
41
|
/* Publish the time as fast as possible in a loop */
|
|
39
42
|
function sendTime() {
|
|
@@ -43,11 +46,11 @@ function sendTime() {
|
|
|
43
46
|
sendTime();
|
|
44
47
|
|
|
45
48
|
/* Make a connection to the server */
|
|
46
|
-
const ws = new wsc.WebSocket(
|
|
47
|
-
ws.on(
|
|
48
|
-
console.log(
|
|
49
|
+
const ws = new wsc.WebSocket("ws://localhost:9001");
|
|
50
|
+
ws.on("message", function message(data) {
|
|
51
|
+
console.log("received: %s", data);
|
|
49
52
|
|
|
50
53
|
/* If we pause receive, we will become slow receiver */
|
|
51
54
|
console.log("Will become slow receiver");
|
|
52
55
|
ws._socket.pause();
|
|
53
|
-
});
|
|
56
|
+
});
|
package/index.d.ts
CHANGED
|
@@ -47,13 +47,12 @@ export type RecognizedString = string | ArrayBuffer | Uint8Array | Int8Array | U
|
|
|
47
47
|
/** A WebSocket connection that is valid from open to close event.
|
|
48
48
|
* Read more about this in the user manual.
|
|
49
49
|
*/
|
|
50
|
-
export interface WebSocket {
|
|
51
|
-
/** Sends a message.
|
|
52
|
-
* Returning false does not mean nothing was sent, it only means backpressure was built up. This you can check by calling getBufferedAmount() afterwards.
|
|
50
|
+
export interface WebSocket<UserData> {
|
|
51
|
+
/** Sends a message. Returns 1 for success, 2 for dropped due to backpressure limit, and 0 for built up backpressure that will drain over time. You can check backpressure before or after sending by calling getBufferedAmount().
|
|
53
52
|
*
|
|
54
53
|
* Make sure you properly understand the concept of backpressure. Check the backpressure example file.
|
|
55
54
|
*/
|
|
56
|
-
send(message: RecognizedString, isBinary?: boolean, compress?: boolean) :
|
|
55
|
+
send(message: RecognizedString, isBinary?: boolean, compress?: boolean) : number;
|
|
57
56
|
|
|
58
57
|
/** Returns the bytes buffered in backpressure. This is similar to the bufferedAmount property in the browser counterpart.
|
|
59
58
|
* Check backpressure example.
|
|
@@ -63,23 +62,17 @@ export interface WebSocket {
|
|
|
63
62
|
/** Gracefully closes this WebSocket. Immediately calls the close handler.
|
|
64
63
|
* A WebSocket close message is sent with code and shortMessage.
|
|
65
64
|
*/
|
|
66
|
-
end(code?: number, shortMessage?: RecognizedString) :
|
|
65
|
+
end(code?: number, shortMessage?: RecognizedString) : void;
|
|
67
66
|
|
|
68
67
|
/** Forcefully closes this WebSocket. Immediately calls the close handler.
|
|
69
68
|
* No WebSocket close message is sent.
|
|
70
69
|
*/
|
|
71
|
-
close() :
|
|
70
|
+
close() : void;
|
|
72
71
|
|
|
73
|
-
/** Sends a ping control message. Returns
|
|
74
|
-
ping(message?: RecognizedString) :
|
|
72
|
+
/** Sends a ping control message. Returns sendStatus similar to WebSocket.send (regarding backpressure). This helper function correlates to WebSocket::send(message, uWS::OpCode::PING, ...) in C++. */
|
|
73
|
+
ping(message?: RecognizedString) : number;
|
|
75
74
|
|
|
76
|
-
/** Subscribe to a topic
|
|
77
|
-
*
|
|
78
|
-
* MQTT syntax includes things like "root/child/+/grandchild" where "+" is a
|
|
79
|
-
* wildcard and "root/#" where "#" is a terminating wildcard.
|
|
80
|
-
*
|
|
81
|
-
* Read more about MQTT.
|
|
82
|
-
*/
|
|
75
|
+
/** Subscribe to a topic. */
|
|
83
76
|
subscribe(topic: RecognizedString) : boolean;
|
|
84
77
|
|
|
85
78
|
/** Unsubscribe from a topic. Returns true on success, if the WebSocket was subscribed. */
|
|
@@ -91,20 +84,13 @@ export interface WebSocket {
|
|
|
91
84
|
/** Returns a list of topics this websocket is subscribed to. */
|
|
92
85
|
getTopics() : string[];
|
|
93
86
|
|
|
94
|
-
/** Publish a message
|
|
95
|
-
*
|
|
96
|
-
* "parent/child" kind of tree is allowed, but not "parent/#" kind of wildcard publishing.
|
|
97
|
-
*
|
|
98
|
-
* The pub/sub system does not guarantee order between what you manually send using WebSocket.send
|
|
99
|
-
* and what you publish using WebSocket.publish. WebSocket messages are perfectly atomic, but the order in which they appear can get scrambled if you mix the two sending functions on the same socket.
|
|
100
|
-
* This shouldn't matter in most applications. Order is guaranteed relative to other calls to WebSocket.publish.
|
|
101
|
-
*
|
|
102
|
-
* Also keep in mind that backpressure will be automatically managed with pub/sub, meaning some outgoing messages may be dropped if backpressure is greater than specified maxBackpressure.
|
|
87
|
+
/** Publish a message under topic. Backpressure is managed according to maxBackpressure, closeOnBackpressureLimit settings.
|
|
88
|
+
* Order is guaranteed since v20.
|
|
103
89
|
*/
|
|
104
90
|
publish(topic: RecognizedString, message: RecognizedString, isBinary?: boolean, compress?: boolean) : boolean;
|
|
105
91
|
|
|
106
92
|
/** See HttpResponse.cork. Takes a function in which the socket is corked (packing many sends into one single syscall/SSL block) */
|
|
107
|
-
cork(cb: () => void) :
|
|
93
|
+
cork(cb: () => void) : WebSocket<UserData>;
|
|
108
94
|
|
|
109
95
|
/** Returns the remote IP address. Note that the returned IP is binary, not text.
|
|
110
96
|
*
|
|
@@ -118,8 +104,8 @@ export interface WebSocket {
|
|
|
118
104
|
/** Returns the remote IP address as text. See RecognizedString. */
|
|
119
105
|
getRemoteAddressAsText() : ArrayBuffer;
|
|
120
106
|
|
|
121
|
-
/**
|
|
122
|
-
|
|
107
|
+
/** Returns the UserData object. */
|
|
108
|
+
getUserData() : UserData;
|
|
123
109
|
}
|
|
124
110
|
|
|
125
111
|
/** An HttpResponse is valid until either onAborted callback or any of the .end/.tryEnd calls succeed. You may attach user data to this object. */
|
|
@@ -138,15 +124,24 @@ export interface HttpResponse {
|
|
|
138
124
|
* buffer, not in a hash table. You can read about this in
|
|
139
125
|
* the user manual under "corking".
|
|
140
126
|
*/
|
|
127
|
+
|
|
128
|
+
/** Pause http body streaming (throttle) */
|
|
129
|
+
pause() : void;
|
|
130
|
+
|
|
131
|
+
/** Resume http body streaming (unthrottle) */
|
|
132
|
+
resume() : void;
|
|
133
|
+
|
|
141
134
|
writeStatus(status: RecognizedString) : HttpResponse;
|
|
142
135
|
/** Writes key and value to HTTP response.
|
|
143
136
|
* See writeStatus and corking.
|
|
144
137
|
*/
|
|
145
138
|
writeHeader(key: RecognizedString, value: RecognizedString) : HttpResponse;
|
|
146
|
-
/** Enters or continues chunked encoding mode. Writes part of the response. End with zero length write. */
|
|
147
|
-
write(chunk: RecognizedString) :
|
|
139
|
+
/** Enters or continues chunked encoding mode. Writes part of the response. End with zero length write. Returns true if no backpressure was added. */
|
|
140
|
+
write(chunk: RecognizedString) : boolean;
|
|
148
141
|
/** Ends this response by copying the contents of body. */
|
|
149
142
|
end(body?: RecognizedString, closeConnection?: boolean) : HttpResponse;
|
|
143
|
+
/** Ends this response without a body. */
|
|
144
|
+
endWithoutBody(reportedContentLength?: number, closeConnection?: boolean) : HttpResponse;
|
|
150
145
|
/** Ends this response, or tries to, by streaming appropriately sized chunks of body. Use in conjunction with onWritable. Returns tuple [ok, hasResponded].*/
|
|
151
146
|
tryEnd(fullBodyOrChunk: RecognizedString, totalSize: number) : [boolean, boolean];
|
|
152
147
|
|
|
@@ -164,7 +159,7 @@ export interface HttpResponse {
|
|
|
164
159
|
|
|
165
160
|
/** Every HttpResponse MUST have an attached abort handler IF you do not respond
|
|
166
161
|
* to it immediately inside of the callback. Returning from an Http request handler
|
|
167
|
-
* without attaching (by calling onAborted) an abort handler is ill-use and will
|
|
162
|
+
* without attaching (by calling onAborted) an abort handler is ill-use and will terminate.
|
|
168
163
|
* When this event emits, the response has been aborted and may not be used. */
|
|
169
164
|
onAborted(handler: () => void) : HttpResponse;
|
|
170
165
|
|
|
@@ -192,14 +187,16 @@ export interface HttpResponse {
|
|
|
192
187
|
*
|
|
193
188
|
* Example usage:
|
|
194
189
|
*
|
|
190
|
+
* ```
|
|
195
191
|
* res.cork(() => {
|
|
196
192
|
* res.writeStatus("200 OK").writeHeader("Some", "Value").write("Hello world!");
|
|
197
193
|
* });
|
|
194
|
+
* ```
|
|
198
195
|
*/
|
|
199
|
-
cork(cb: () => void) :
|
|
196
|
+
cork(cb: () => void) : HttpResponse;
|
|
200
197
|
|
|
201
198
|
/** Upgrades a HttpResponse to a WebSocket. See UpgradeAsync, UpgradeSync example files. */
|
|
202
|
-
upgrade<
|
|
199
|
+
upgrade<UserData>(userData : UserData, secWebSocketKey: RecognizedString, secWebSocketProtocol: RecognizedString, secWebSocketExtensions: RecognizedString, context: us_socket_context_t) : void;
|
|
203
200
|
|
|
204
201
|
/** Arbitrary user data may be attached to this object */
|
|
205
202
|
[key: string]: any;
|
|
@@ -213,46 +210,58 @@ export interface HttpRequest {
|
|
|
213
210
|
getParameter(index: number) : string;
|
|
214
211
|
/** Returns the URL including initial /slash */
|
|
215
212
|
getUrl() : string;
|
|
216
|
-
/** Returns the HTTP method, useful for "any" routes. */
|
|
213
|
+
/** Returns the lowercased HTTP method, useful for "any" routes. */
|
|
217
214
|
getMethod() : string;
|
|
215
|
+
/** Returns the HTTP method as-is. */
|
|
216
|
+
getCaseSensitiveMethod() : string;
|
|
218
217
|
/** Returns the raw querystring (the part of URL after ? sign) or empty string. */
|
|
219
218
|
getQuery() : string;
|
|
220
|
-
/** Returns a decoded query parameter value or
|
|
221
|
-
getQuery(key: string) : string;
|
|
219
|
+
/** Returns a decoded query parameter value or undefined. */
|
|
220
|
+
getQuery(key: string) : string | undefined;
|
|
222
221
|
/** Loops over all headers. */
|
|
223
222
|
forEach(cb: (key: string, value: string) => void) : void;
|
|
224
223
|
/** Setting yield to true is to say that this route handler did not handle the route, causing the router to continue looking for a matching route handler, or fail. */
|
|
225
|
-
setYield(
|
|
224
|
+
setYield(_yield: boolean) : HttpRequest;
|
|
226
225
|
}
|
|
227
226
|
|
|
228
227
|
/** A structure holding settings and handlers for a WebSocket URL route handler. */
|
|
229
|
-
export interface WebSocketBehavior {
|
|
228
|
+
export interface WebSocketBehavior<UserData> {
|
|
230
229
|
/** Maximum length of received message. If a client tries to send you a message larger than this, the connection is immediately closed. Defaults to 16 * 1024. */
|
|
231
230
|
maxPayloadLength?: number;
|
|
231
|
+
/** Whether or not we should automatically close the socket when a message is dropped due to backpressure. Defaults to false. */
|
|
232
|
+
closeOnBackpressureLimit?: number;
|
|
233
|
+
/** Maximum number of minutes a WebSocket may be connected before being closed by the server. 0 disables the feature. */
|
|
234
|
+
maxLifetime?: number;
|
|
232
235
|
/** Maximum amount of seconds that may pass without sending or getting a message. Connection is closed if this timeout passes. Resolution (granularity) for timeouts are typically 4 seconds, rounded to closest.
|
|
233
236
|
* Disable by using 0. Defaults to 120.
|
|
234
237
|
*/
|
|
235
238
|
idleTimeout?: number;
|
|
236
239
|
/** What permessage-deflate compression to use. uWS.DISABLED, uWS.SHARED_COMPRESSOR or any of the uWS.DEDICATED_COMPRESSOR_xxxKB. Defaults to uWS.DISABLED. */
|
|
237
240
|
compression?: CompressOptions;
|
|
238
|
-
/** Maximum length of allowed backpressure per socket when publishing or sending messages. Slow receivers with too high backpressure will be skipped until they catch up or timeout. Defaults to
|
|
241
|
+
/** Maximum length of allowed backpressure per socket when publishing or sending messages. Slow receivers with too high backpressure will be skipped until they catch up or timeout. Defaults to 64 * 1024. */
|
|
239
242
|
maxBackpressure?: number;
|
|
243
|
+
/** Whether or not we should automatically send pings to uphold a stable connection given whatever idleTimeout. */
|
|
244
|
+
sendPingsAutomatically?: boolean;
|
|
240
245
|
/** Upgrade handler used to intercept HTTP upgrade requests and potentially upgrade to WebSocket.
|
|
241
246
|
* See UpgradeAsync and UpgradeSync example files.
|
|
242
247
|
*/
|
|
243
|
-
upgrade?: (res: HttpResponse, req: HttpRequest, context: us_socket_context_t) => void
|
|
248
|
+
upgrade?: (res: HttpResponse, req: HttpRequest, context: us_socket_context_t) => void | Promise<void>;
|
|
244
249
|
/** Handler for new WebSocket connection. WebSocket is valid from open to close, no errors. */
|
|
245
|
-
open?: (ws: WebSocket) => void
|
|
250
|
+
open?: (ws: WebSocket<UserData>) => void | Promise<void>;
|
|
246
251
|
/** Handler for a WebSocket message. Messages are given as ArrayBuffer no matter if they are binary or not. Given ArrayBuffer is valid during the lifetime of this callback (until first await or return) and will be neutered. */
|
|
247
|
-
message?: (ws: WebSocket
|
|
252
|
+
message?: (ws: WebSocket<UserData>, message: ArrayBuffer, isBinary: boolean) => void | Promise<void>;
|
|
253
|
+
/** Handler for a dropped WebSocket message. Messages can be dropped due to specified backpressure settings. Messages are given as ArrayBuffer no matter if they are binary or not. Given ArrayBuffer is valid during the lifetime of this callback (until first await or return) and will be neutered. */
|
|
254
|
+
dropped?: (ws: WebSocket<UserData>, message: ArrayBuffer, isBinary: boolean) => void | Promise<void>;
|
|
248
255
|
/** Handler for when WebSocket backpressure drains. Check ws.getBufferedAmount(). Use this to guide / drive your backpressure throttling. */
|
|
249
|
-
drain?: (ws: WebSocket) => void;
|
|
256
|
+
drain?: (ws: WebSocket<UserData>) => void;
|
|
250
257
|
/** Handler for close event, no matter if error, timeout or graceful close. You may not use WebSocket after this event. Do not send on this WebSocket from within here, it is closed. */
|
|
251
|
-
close?: (ws: WebSocket
|
|
258
|
+
close?: (ws: WebSocket<UserData>, code: number, message: ArrayBuffer) => void;
|
|
252
259
|
/** Handler for received ping control message. You do not need to handle this, pong messages are automatically sent as per the standard. */
|
|
253
|
-
ping?: (ws: WebSocket
|
|
260
|
+
ping?: (ws: WebSocket<UserData>, message: ArrayBuffer) => void;
|
|
254
261
|
/** Handler for received pong control message. */
|
|
255
|
-
pong?: (ws: WebSocket
|
|
262
|
+
pong?: (ws: WebSocket<UserData>, message: ArrayBuffer) => void;
|
|
263
|
+
/** Handler for subscription changes. */
|
|
264
|
+
subscription?: (ws: WebSocket<UserData>, topic: ArrayBuffer, newCount: number, oldCount: number) => void;
|
|
256
265
|
}
|
|
257
266
|
|
|
258
267
|
/** Options used when constructing an app. Especially for SSLApp.
|
|
@@ -261,8 +270,10 @@ export interface WebSocketBehavior {
|
|
|
261
270
|
export interface AppOptions {
|
|
262
271
|
key_file_name?: RecognizedString;
|
|
263
272
|
cert_file_name?: RecognizedString;
|
|
273
|
+
ca_file_name?: RecognizedString;
|
|
264
274
|
passphrase?: RecognizedString;
|
|
265
275
|
dh_params_file_name?: RecognizedString;
|
|
276
|
+
ssl_ciphers?: RecognizedString;
|
|
266
277
|
/** This translates to SSL_MODE_RELEASE_BUFFERS */
|
|
267
278
|
ssl_prefer_low_memory_usage?: boolean;
|
|
268
279
|
}
|
|
@@ -275,58 +286,66 @@ export enum ListenOptions {
|
|
|
275
286
|
/** TemplatedApp is either an SSL or non-SSL app. See App for more info, read user manual. */
|
|
276
287
|
export interface TemplatedApp {
|
|
277
288
|
/** Listens to hostname & port. Callback hands either false or a listen socket. */
|
|
278
|
-
listen(host: RecognizedString, port: number, cb: (listenSocket: us_listen_socket) => void): TemplatedApp;
|
|
289
|
+
listen(host: RecognizedString, port: number, cb: (listenSocket: us_listen_socket | false) => void | Promise<void>) : TemplatedApp;
|
|
279
290
|
/** Listens to port. Callback hands either false or a listen socket. */
|
|
280
|
-
listen(port: number, cb: (listenSocket:
|
|
291
|
+
listen(port: number, cb: (listenSocket: us_listen_socket | false) => void | Promise<void>) : TemplatedApp;
|
|
281
292
|
/** Listens to port and sets Listen Options. Callback hands either false or a listen socket. */
|
|
282
|
-
listen(port: number, options: ListenOptions, cb: (listenSocket: us_listen_socket | false) => void): TemplatedApp;
|
|
293
|
+
listen(port: number, options: ListenOptions, cb: (listenSocket: us_listen_socket | false) => void | Promise<void>) : TemplatedApp;
|
|
294
|
+
/** Listens to unix socket. Callback hands either false or a listen socket. */
|
|
295
|
+
listen_unix(cb: (listenSocket: us_listen_socket) => void | Promise<void>, path: RecognizedString) : TemplatedApp;
|
|
283
296
|
/** Registers an HTTP GET handler matching specified URL pattern. */
|
|
284
|
-
get(pattern: RecognizedString, handler: (res: HttpResponse, req: HttpRequest) => void) : TemplatedApp;
|
|
297
|
+
get(pattern: RecognizedString, handler: (res: HttpResponse, req: HttpRequest) => void | Promise<void>) : TemplatedApp;
|
|
285
298
|
/** Registers an HTTP POST handler matching specified URL pattern. */
|
|
286
|
-
post(pattern: RecognizedString, handler: (res: HttpResponse, req: HttpRequest) => void) : TemplatedApp;
|
|
299
|
+
post(pattern: RecognizedString, handler: (res: HttpResponse, req: HttpRequest) => void | Promise<void>) : TemplatedApp;
|
|
287
300
|
/** Registers an HTTP OPTIONS handler matching specified URL pattern. */
|
|
288
|
-
options(pattern: RecognizedString, handler: (res: HttpResponse, req: HttpRequest) => void) : TemplatedApp;
|
|
301
|
+
options(pattern: RecognizedString, handler: (res: HttpResponse, req: HttpRequest) => void | Promise<void>) : TemplatedApp;
|
|
289
302
|
/** Registers an HTTP DELETE handler matching specified URL pattern. */
|
|
290
|
-
del(pattern: RecognizedString, handler: (res: HttpResponse, req: HttpRequest) => void) : TemplatedApp;
|
|
303
|
+
del(pattern: RecognizedString, handler: (res: HttpResponse, req: HttpRequest) => void | Promise<void>) : TemplatedApp;
|
|
291
304
|
/** Registers an HTTP PATCH handler matching specified URL pattern. */
|
|
292
|
-
patch(pattern: RecognizedString, handler: (res: HttpResponse, req: HttpRequest) => void) : TemplatedApp;
|
|
305
|
+
patch(pattern: RecognizedString, handler: (res: HttpResponse, req: HttpRequest) => void | Promise<void>) : TemplatedApp;
|
|
293
306
|
/** Registers an HTTP PUT handler matching specified URL pattern. */
|
|
294
|
-
put(pattern: RecognizedString, handler: (res: HttpResponse, req: HttpRequest) => void) : TemplatedApp;
|
|
307
|
+
put(pattern: RecognizedString, handler: (res: HttpResponse, req: HttpRequest) => void | Promise<void>) : TemplatedApp;
|
|
295
308
|
/** Registers an HTTP HEAD handler matching specified URL pattern. */
|
|
296
|
-
head(pattern: RecognizedString, handler: (res: HttpResponse, req: HttpRequest) => void) : TemplatedApp;
|
|
309
|
+
head(pattern: RecognizedString, handler: (res: HttpResponse, req: HttpRequest) => void | Promise<void>) : TemplatedApp;
|
|
297
310
|
/** Registers an HTTP CONNECT handler matching specified URL pattern. */
|
|
298
|
-
connect(pattern: RecognizedString, handler: (res: HttpResponse, req: HttpRequest) => void) : TemplatedApp;
|
|
311
|
+
connect(pattern: RecognizedString, handler: (res: HttpResponse, req: HttpRequest) => void | Promise<void>) : TemplatedApp;
|
|
299
312
|
/** Registers an HTTP TRACE handler matching specified URL pattern. */
|
|
300
|
-
trace(pattern: RecognizedString, handler: (res: HttpResponse, req: HttpRequest) => void) : TemplatedApp;
|
|
313
|
+
trace(pattern: RecognizedString, handler: (res: HttpResponse, req: HttpRequest) => void | Promise<void>) : TemplatedApp;
|
|
301
314
|
/** Registers an HTTP handler matching specified URL pattern on any HTTP method. */
|
|
302
|
-
any(pattern: RecognizedString, handler: (res: HttpResponse, req: HttpRequest) => void) : TemplatedApp;
|
|
315
|
+
any(pattern: RecognizedString, handler: (res: HttpResponse, req: HttpRequest) => void | Promise<void>) : TemplatedApp;
|
|
303
316
|
/** Registers a handler matching specified URL pattern where WebSocket upgrade requests are caught. */
|
|
304
|
-
ws(pattern: RecognizedString, behavior: WebSocketBehavior) : TemplatedApp;
|
|
317
|
+
ws<UserData>(pattern: RecognizedString, behavior: WebSocketBehavior<UserData>) : TemplatedApp;
|
|
305
318
|
/** Publishes a message under topic, for all WebSockets under this app. See WebSocket.publish. */
|
|
306
319
|
publish(topic: RecognizedString, message: RecognizedString, isBinary?: boolean, compress?: boolean) : boolean;
|
|
307
320
|
/** Returns number of subscribers for this topic. */
|
|
308
321
|
numSubscribers(topic: RecognizedString) : number;
|
|
309
322
|
/** Adds a server name. */
|
|
310
|
-
addServerName(hostname: string, options: AppOptions): TemplatedApp;
|
|
323
|
+
addServerName(hostname: string, options: AppOptions) : TemplatedApp;
|
|
324
|
+
/** Browse to SNI domain. Used together with .get, .post and similar to attach routes under SNI domains. */
|
|
325
|
+
domain(domain: string) : TemplatedApp;
|
|
311
326
|
/** Removes a server name. */
|
|
312
|
-
removeServerName(hostname: string): TemplatedApp;
|
|
327
|
+
removeServerName(hostname: string) : TemplatedApp;
|
|
313
328
|
/** Registers a synchronous callback on missing server names. See /examples/ServerName.js. */
|
|
314
|
-
missingServerName(cb: (hostname: string) => void): TemplatedApp;
|
|
329
|
+
missingServerName(cb: (hostname: string) => void) : TemplatedApp;
|
|
330
|
+
/** Attaches a "filter" function to track socket connections / disconnections */
|
|
331
|
+
filter(cb: (res: HttpResponse, count: Number) => void | Promise<void>) : TemplatedApp;
|
|
332
|
+
/** Closes all sockets including listen sockets. This will forcefully terminate all connections. */
|
|
333
|
+
close() : TemplatedApp;
|
|
315
334
|
}
|
|
316
335
|
|
|
317
336
|
/** Constructs a non-SSL app. An app is your starting point where you attach behavior to URL routes.
|
|
318
337
|
* This is also where you listen and run your app, set any SSL options (in case of SSLApp) and the like.
|
|
319
338
|
*/
|
|
320
|
-
export function App(options?: AppOptions): TemplatedApp;
|
|
339
|
+
export function App(options?: AppOptions) : TemplatedApp;
|
|
321
340
|
|
|
322
341
|
/** Constructs an SSL app. See App. */
|
|
323
|
-
export function SSLApp(options: AppOptions): TemplatedApp;
|
|
342
|
+
export function SSLApp(options: AppOptions) : TemplatedApp;
|
|
324
343
|
|
|
325
344
|
/** Closes a uSockets listen socket. */
|
|
326
|
-
export function us_listen_socket_close(listenSocket: us_listen_socket): void;
|
|
345
|
+
export function us_listen_socket_close(listenSocket: us_listen_socket) : void;
|
|
327
346
|
|
|
328
347
|
/** Gets local port of socket (or listenSocket) or -1. */
|
|
329
|
-
export function us_socket_local_port(socket: us_socket): number;
|
|
348
|
+
export function us_socket_local_port(socket: us_socket) : number;
|
|
330
349
|
|
|
331
350
|
export interface MultipartField {
|
|
332
351
|
data: ArrayBuffer;
|
|
@@ -336,14 +355,16 @@ export interface MultipartField {
|
|
|
336
355
|
}
|
|
337
356
|
|
|
338
357
|
/** Takes a POSTed body and contentType, and returns an array of parts if the request is a multipart request */
|
|
339
|
-
export function getParts(body: RecognizedString, contentType: RecognizedString): MultipartField[] | undefined;
|
|
358
|
+
export function getParts(body: RecognizedString, contentType: RecognizedString) : MultipartField[] | undefined;
|
|
340
359
|
|
|
341
|
-
/** WebSocket compression options */
|
|
360
|
+
/** WebSocket compression options. Combine any compressor with any decompressor using bitwise OR. */
|
|
342
361
|
export type CompressOptions = number;
|
|
343
362
|
/** No compression (always a good idea if you operate using an efficient binary protocol) */
|
|
344
363
|
export var DISABLED: CompressOptions;
|
|
345
|
-
/** Zero memory overhead compression
|
|
364
|
+
/** Zero memory overhead compression. */
|
|
346
365
|
export var SHARED_COMPRESSOR: CompressOptions;
|
|
366
|
+
/** Zero memory overhead decompression. */
|
|
367
|
+
export var SHARED_DECOMPRESSOR: CompressOptions;
|
|
347
368
|
/** Sliding dedicated compress window, requires 3KB of memory per socket */
|
|
348
369
|
export var DEDICATED_COMPRESSOR_3KB: CompressOptions;
|
|
349
370
|
/** Sliding dedicated compress window, requires 4KB of memory per socket */
|
|
@@ -360,3 +381,19 @@ export var DEDICATED_COMPRESSOR_64KB: CompressOptions;
|
|
|
360
381
|
export var DEDICATED_COMPRESSOR_128KB: CompressOptions;
|
|
361
382
|
/** Sliding dedicated compress window, requires 256KB of memory per socket */
|
|
362
383
|
export var DEDICATED_COMPRESSOR_256KB: CompressOptions;
|
|
384
|
+
/** Sliding dedicated decompress window, requires 32KB of memory per socket (plus about 23KB) */
|
|
385
|
+
export var DEDICATED_DECOMPRESSOR_32KB: CompressOptions;
|
|
386
|
+
/** Sliding dedicated decompress window, requires 16KB of memory per socket (plus about 23KB) */
|
|
387
|
+
export var DEDICATED_DECOMPRESSOR_16KB: CompressOptions;
|
|
388
|
+
/** Sliding dedicated decompress window, requires 8KB of memory per socket (plus about 23KB) */
|
|
389
|
+
export var DEDICATED_DECOMPRESSOR_8KB: CompressOptions;
|
|
390
|
+
/** Sliding dedicated decompress window, requires 4KB of memory per socket (plus about 23KB) */
|
|
391
|
+
export var DEDICATED_DECOMPRESSOR_4KB: CompressOptions;
|
|
392
|
+
/** Sliding dedicated decompress window, requires 2KB of memory per socket (plus about 23KB) */
|
|
393
|
+
export var DEDICATED_DECOMPRESSOR_2KB: CompressOptions;
|
|
394
|
+
/** Sliding dedicated decompress window, requires 1KB of memory per socket (plus about 23KB) */
|
|
395
|
+
export var DEDICATED_DECOMPRESSOR_1KB: CompressOptions;
|
|
396
|
+
/** Sliding dedicated decompress window, requires 512B of memory per socket (plus about 23KB) */
|
|
397
|
+
export var DEDICATED_DECOMPRESSOR_512B: CompressOptions;
|
|
398
|
+
/** Sliding dedicated decompress window, requires 32KB of memory per socket (plus about 23KB) */
|
|
399
|
+
export var DEDICATED_DECOMPRESSOR: CompressOptions;
|
package/logo.svg
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg version="1.1" viewBox="0.0 0.0 187.65616797900262 113.39370078740157" fill="none" stroke="none" stroke-linecap="square" stroke-miterlimit="10" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg"><clipPath id="p.0"><path d="m0 0l187.65617 0l0 113.3937l-187.65617 0l0 -113.3937z" clip-rule="nonzero"/></clipPath><g clip-path="url(#p.0)"><path fill="#000000" fill-opacity="0.0" d="m0 0l187.65617 0l0 113.3937l-187.65617 0z" fill-rule="evenodd"/><g filter="url(#shadowFilter-p.1)"><use xlink:href="#p.1" transform="matrix(1.0 0.0 0.0 1.0 0.0 2.0)"/></g><defs><filter id="shadowFilter-p.1" filterUnits="userSpaceOnUse"><feGaussianBlur in="SourceAlpha" stdDeviation="2.0" result="blur"/><feComponentTransfer in="blur" color-interpolation-filters="sRGB"><feFuncR type="linear" slope="0" intercept="0.0"/><feFuncG type="linear" slope="0" intercept="0.0"/><feFuncB type="linear" slope="0" intercept="0.0"/><feFuncA type="linear" slope="0.5" intercept="0"/></feComponentTransfer></filter></defs><g id="p.1"><defs><linearGradient id="p.2" gradientUnits="userSpaceOnUse" gradientTransform="matrix(10.20750017422515 0.0 0.0 10.20750017422515 0.0 0.0)" spreadMethod="pad" x1="0.6655852909187749" y1="0.31561582701378876" x2="0.6655483156810289" y2="10.523116001171969"><stop offset="0.0" stop-color="#3177ee"/><stop offset="1.0" stop-color="#113d8a"/></linearGradient></defs><path fill="url(#p.2)" d="m103.745865 15.829906c1.2349167 0 1.8523712 1.2349148 1.8523712 3.7047462c0 4.1163883 -2.2017822 10.58773 -6.605362 19.414024c-0.29676056 -3.4079819 -0.44514465 -6.2320175 -0.44514465 -8.4720955c0 -9.76445 1.7327118 -14.646675 5.1981354 -14.646675zm47.55861 -12.607628c-1.3497925 0 -2.733078 0.34941483 -4.149887 1.0482426c-5.7629395 2.7091556 -11.377502 7.533942 -16.843674 14.474361c-4.4705887 5.8778133 -8.94117 12.966614 -13.411758 21.266397c-4.882225 9.4676895 -8.409874 16.231007 -10.582939 20.289951c-3.771759 7.055298 -6.772888 11.377502 -9.003395 12.966614c2.5847015 -4.1163864 3.87706 -9.20443 3.87706 -15.264133c0 -1.177475 -0.24890137 -3.4558449 -0.7466965 -6.8351135c-0.4977951 -3.3792686 -0.89507294 -6.480915 -1.1918335 -9.304947c5.7054977 -9.821888 8.55825 -17.087786 8.55825 -21.797697c0 -3.23567 -1.2923508 -4.853506 -3.87706 -4.853506c-0.6509628 0 -1.3880844 0.26804543 -2.2113647 0.80413055c-2.9389038 1.7039948 -5.025818 5.3465176 -6.2607346 10.927568c-0.8807144 4.0015106 -1.3210678 7.8881474 -1.3210678 11.659903c0 3.7621841 0.11487579 6.701092 0.34462738 8.816723c-3.1112213 5.466175 -6.6388702 10.908421 -10.582947 16.326736c-6.117134 8.519962 -11.119026 13.603222 -15.005661 15.249767c-0.64138794 0.29676056 -0.9620819 0.5935211 -0.9620819 0.8902893c0 0.29676056 0.08615875 0.44514465 0.25846863 0.44514465c2.125206 0 6.744171 -4.5328064 13.856903 -13.598427c5.351303 -6.7010956 9.558632 -12.492756 12.621986 -17.37498c0.11487579 1.646553 0.6126709 4.824787 1.4933853 9.5346985c0.6509628 4.0589447 0.97644806 7.304188 0.97644806 9.735729c0 2.4411163 -0.32548523 4.164253 -0.97644806 5.1694183c-0.46907043 0.11487579 -0.7036133 0.36377716 -0.7036133 0.74668884c0 0.3829193 0.05744171 0.57437897 0.1723175 0.57437897c2.4123917 0 6.7633133 -5.6480637 13.0527725 -16.944191c1.177475 -2.0581932 3.3074646 -5.9208946 6.389969 -11.588104c3.0920715 -5.6767807 5.523613 -10.046848 7.2946167 -13.110207c5.7629395 -9.707012 11.468445 -16.88197 17.1165 -21.524868c4.4035797 -3.4079847 8.285431 -5.1119766 11.645554 -5.1119766c4.0589447 0 6.0884094 1.9672489 6.0884094 5.9017477l-0.52537537 2.880206l0 0c-2.3648834 0.9902582 -4.4858246 2.3851423 -6.3628387 4.184661l-0.1723175 0c-2.115631 0 -3.9392853 0.83763504 -5.4709625 2.512909c-1.5316772 1.6752758 -2.2975159 3.5994453 -2.2975159 5.7725143c0 4.413147 1.8810883 8.003017 5.64328 10.769611c1.1200409 0.8232765 2.8383942 2.0151138 5.15506 3.575512c2.326233 1.5603981 4.049362 2.7809525 5.169403 3.6616707c3.7047577 2.757019 5.557129 6.313385 5.557129 10.669098c0 3.1207962 -1.2636414 6.0932083 -3.7909088 8.917236c-2.5272675 2.8240356 -5.38002 4.882225 -8.558258 6.1745834c-1.2923431 0.41163635 -2.8527374 0.7323303 -4.681183 0.9620819c-0.41163635 0 -0.61746216 0.17710114 -0.61746216 0.5313034c0 0.18188477 0.14837646 0.27282715 0.44514465 0.27282715c4.298279 0 8.5056 -1.780571 12.621994 -5.341728c4.116379 -3.5611496 6.174576 -7.4286423 6.174576 -11.602463c0 -4.1738205 -1.8810883 -7.821129 -5.64328 -10.941925c-5.829956 -3.9440765 -9.362381 -6.385189 -10.597305 -7.3233376c-3.8196106 -2.8814735 -5.729431 -6.3516846 -5.729431 -10.410627c0 -1.7614326 0.5887451 -3.4654255 1.7662201 -5.1119766c1.234909 -1.5316811 2.7330933 -2.3836746 4.494522 -2.5559883l0 0c-1.9433136 2.1156292 -2.914978 4.4657993 -2.914978 7.0505066c0 3.8866348 2.0007477 7.179743 6.0022583 9.879324c1.0626068 0.7084007 2.857544 1.8571587 5.3848114 3.4462776c2.5272675 1.5891151 4.437088 2.8527489 5.729431 3.790905c4.0589447 2.824028 6.0884247 6.5287743 6.0884247 11.114239c0 7.4765053 -4.4083557 12.976185 -13.225082 16.49905c-5.1215515 2.115631 -9.946335 3.1734467 -14.474365 3.1734467c-4.528015 0 -8.4673 -1.3402252 -11.817856 -4.0206604c-3.3505402 -2.6708603 -5.025818 -6.428253 -5.025818 -11.27219c0 -4.853508 1.8523712 -8.7257805 5.5571136 -11.616825c3.4654236 -2.8144608 7.5818176 -4.2216873 12.349167 -4.2216873l1.4933777 0c0.94773865 0 1.4216003 -0.062229156 1.4216003 -0.18667603c0 -0.46907425 -1.3833008 -0.7036133 -4.1499023 -0.7036133c-4.997101 0 -9.395889 1.6321907 -13.196365 4.8965836c-3.7909012 3.2643929 -5.6863556 7.4717216 -5.6863556 12.621986c0 5.1406937 2.3549576 9.065628 7.064865 11.77478c3.7621918 2.230507 8.831085 3.3457565 15.206696 3.3457565c6.385193 0 12.373093 -1.646553 17.963715 -4.939659c6.7010956 -3.9345016 10.051651 -9.1661415 10.051651 -15.69492c0 -4.824787 -1.9720459 -8.855011 -5.916107 -12.090683c-4.700348 -2.9389114 -8.376373 -5.293865 -11.028091 -7.064869c-3.9919434 -2.6995811 -5.9879 -5.844309 -5.9879 -9.434181c0 -1.589117 0.41163635 -3.1160088 1.234909 -4.580675c2.699585 -4.7673492 7.725403 -7.151024 15.077454 -7.151024c2.6517181 0 5.0354004 0.38292122 7.1510315 1.1487598c3.0537872 1.0530262 4.580673 2.6421452 4.580673 4.7673473c0 1.4646683 -0.8232727 2.5655632 -2.4698334 3.3026829c-1.6465454 0.73711777 -3.4654083 1.1056805 -5.456604 1.1056805c-5.88739 0 -10.448914 -1.0578175 -13.684586 -3.1734467c-0.057434082 -0.06701279 -0.16275024 -0.10051727 -0.3159027 -0.10051727c-0.14360046 0 -0.21539307 0.062223434 -0.21539307 0.18667412c0 0.11487579 0.06222534 0.22975159 0.18666077 0.34462738c1.8188782 1.2923546 4.0828857 2.2065754 6.792038 2.7426624c2.5847168 0.64138985 5.05455 0.9620838 7.4095 0.9620838c2.35495 0 4.413147 -0.34941292 6.174576 -1.0482407c2.4698334 -0.8902893 3.7047424 -2.3023033 3.7047424 -4.2360497c0 -1.0051632 -0.354187 -1.948103 -1.0625916 -2.8288174c-2.2879486 -2.8814716 -6.729828 -4.3222055 -13.325607 -4.3222055c-3.337906 0 -6.3659973 0.5138922 -9.08429 1.5416708l0 0c0.044937134 -0.20180702 0.08959961 -0.41893482 0.13400269 -0.65138245c0.32546997 -1.7135639 0.4882202 -2.8910418 0.4882202 -3.5324335c0 -2.2400799 -0.5887451 -4.125959 -1.7662201 -5.6576366c-1.0626068 -1.5221055 -2.7091522 -2.2831583 -4.9396667 -2.2831583zm-88.39699 5.02582c-0.8232727 0 -1.2349129 0.29197693 -1.2349129 0.8759289c0 0.18188572 0.14359283 0.3302679 0.43078232 0.4451437c3.178234 0.5935259 5.590626 3.1543016 7.237179 7.6823244c-1.1200409 -0.18188858 -2.2352905 -0.27283096 -3.3457565 -0.27283096c-4.7673492 0 -9.386318 1.4263744 -13.856903 4.279127c-4.470585 2.8527527 -7.677536 6.3995457 -9.620857 10.640379c-1.4072266 3.1686592 -2.1108437 6.0501328 -2.1108437 8.644409c0 2.5847092 0.24889755 4.6141853 0.74669266 6.088421c0.49779892 1.4646683 1.541256 2.699585 3.130371 3.7047462c1.3593636 0.9381561 3.1255798 1.4072304 5.298649 1.4072304c2.1730652 0 4.8487167 -1.0721703 8.026951 -3.2165222c3.1782303 -2.153923 5.4709625 -4.403576 6.8781967 -6.7489586c0.12445068 -0.23932648 0.1866684 -0.44514465 0.1866684 -0.61745834c0 -0.18188858 -0.062217712 -0.27283096 -0.1866684 -0.27283096c-0.11487579 0 -0.25847626 0.11966324 -0.43078613 0.3589859c-1.7710037 2.4123955 -3.8627014 4.4418716 -6.275097 6.0884247c-2.4123917 1.6465492 -4.781708 2.4698296 -7.1079445 2.4698296c-2.3166618 0 -4.197754 -0.7036133 -5.643276 -2.1108437c-1.4359512 -1.4168015 -2.153923 -3.7143173 -2.153923 -6.8925514c0 -5.590626 2.0438309 -10.750467 6.1315002 -15.4795265c4.0876656 -4.7386303 8.898094 -7.1079445 14.431282 -7.1079445c2.5272713 0 4.762562 0.61745834 6.7058754 1.8523731c0.9381561 3.829197 1.4072342 8.553467 1.4072342 14.1728115c0 5.6097717 -1.0290985 12.353947 -3.087288 20.232513c-1.1200409 4.413151 -2.8719025 10.324467 -5.2555733 17.733967c-2.3836746 7.4094925 -3.575512 11.425362 -3.575512 12.047607c0 0.6222458 0.057437897 0.93336487 0.17231369 0.93336487c0.12445068 0 0.27283096 -0.1483841 0.44514465 -0.44514465c3.829197 -6.4139023 6.8446846 -14.383415 9.046474 -23.908543c2.211357 -9.5346985 3.3170395 -18.504585 3.3170395 -26.909676c0 -4.7673473 -0.35420227 -9.032114 -1.0625992 -12.7943l0 0c3.87706 3.4079838 5.81559 9.170923 5.81559 17.288822c0 4.4705887 -0.8519974 9.91283 -2.5559921 16.326733c-1.1200333 3.87706 -2.6804352 8.711418 -4.6811905 14.503082c-1.9911804 5.8012314 -2.9867706 8.859802 -2.9867706 9.175705c0 0.32548523 0.23453522 0.48822784 0.7036133 0.48822784c0.1723175 0 0.34941864 -0.08615875 0.5313034 -0.25847626c5.2268524 -10.118645 8.429016 -16.647423 9.606491 -19.586334c3.0633621 -7.4094925 4.5950394 -14.407352 4.5950394 -20.993565c0 -11.411007 -3.9727936 -18.236547 -11.918373 -20.476627c-1.7614288 -6.2320166 -4.346138 -9.348024 -7.7541237 -9.348024zm-36.48411 29.724134c-1.091322 0 -1.814085 0.7658386 -2.1682816 2.2975159c-0.995594 3.829193 -3.082508 8.39072 -6.2607365 13.684589c-0.35419846 0.64138794 -0.62224007 1.139183 -0.80413055 1.4933853c-0.17231369 0.35419846 -0.36377716 0.6796799 -0.57437897 0.97644806c-0.20103264 0.28718948 -0.3589878 0.5504494 -0.4738636 0.7897682c0 0.2297554 0.16274261 0.3446312 0.48822212 0.3446312c0.3254795 0 1.9002342 -2.4411125 4.72427 -7.3233376c1.7614288 -2.9963455 2.8479614 -5.1119766 3.2596035 -6.3468933l0 0c0 3.5898705 -0.61745834 7.1941032 -1.8523731 10.812691c-1.2349148 3.6185913 -3.001133 7.8689995 -5.2986507 12.7512245l-5.4709625 11.817856c-3.4654255 7.466934 -5.198134 13.08149 -5.198134 16.843674l0 0.27283478c0 2.9389114 1.1056805 5.509262 3.317041 7.7110443c2.2017899 2.2113647 4.7146997 3.317047 7.5387297 3.317047c1.1104698 0 2.5033398 -0.39728546 4.17861 -1.1918411c1.6848488 -0.79455566 2.8192482 -1.7231369 3.4031982 -2.785736l0 0c-3.178236 1.943306 -5.8826065 2.9149704 -8.11311 2.9149704c-3.4175568 0 -5.126335 -2.5320663 -5.126335 -7.596176c0 -5.054535 1.297142 -11.229111 3.8914204 -18.523735c0.17231369 -0.46907043 0.49301147 -1.5125275 0.9620857 -3.1303635c0.46907425 -1.617836 1.732708 -4.8965836 3.790903 -9.83625c6.6532307 -4.882225 11.15732 -9.616066 13.512276 -14.20153l0 0c-0.29676056 3.2356758 -0.44514465 5.734226 -0.44514465 7.4956512c0 4.355713 1.2349167 6.5335693 3.7047462 6.5335693c2.4698334 0 4.7338448 -1.4120178 6.792038 -4.2360497l0 -0.17231369c0 -0.35419846 -0.08615875 -0.5313034 -0.25847244 -0.5313034c0.057437897 0 -0.047863007 0.11966705 -0.31590652 0.35898972c-0.26804733 0.22975159 -0.8567848 0.7275429 -1.7662163 1.4933891c-0.9094353 0.7658386 -1.8045082 1.1487579 -2.6852264 1.1487579c-1.7710037 0 -2.6565018 -1.4120216 -2.6565018 -4.2360497c0 -4.1738205 0.6509628 -8.467308 1.9528885 -12.880459c1.110466 -1.4742393 1.665699 -3.0920715 1.665699 -4.853504c0 -0.65096664 -0.46907806 -0.97644806 -1.4072266 -0.97644806c-0.9381523 0 -1.6130447 0.20582199 -2.0246887 0.61745834c-1.0051651 1.3019257 -1.7997246 4.011078 -2.3836746 8.127468c-3.2931118 5.466175 -7.4094944 10.08036 -12.349157 13.842541c1.8188667 -5.4661713 3.0825005 -9.199638 3.790905 -11.200394c1.5316753 -4.5280266 2.2975178 -8.261494 2.2975178 -11.2003975c0 -2.9484825 -0.5456619 -4.422722 -1.636982 -4.422722z" fill-rule="evenodd"/></g></g></svg>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "uwebsockets",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
|
+
"description": "Fastest uWebSockets server for Node.js – µWebSockets outperforms Socket.IO & Fastify. Built in C++ for high-performance networking & pub/sub.",
|
|
5
5
|
"main": "uws.js",
|
|
6
6
|
"types": "./index.d.ts",
|
|
7
7
|
"repository": {
|
|
@@ -9,12 +9,29 @@
|
|
|
9
9
|
"url": "git+https://github.com/NPM-Package-Jaykumar/uWebSockets.git"
|
|
10
10
|
},
|
|
11
11
|
"keywords": [
|
|
12
|
+
"uWebSockets",
|
|
13
|
+
"uWebSockets npm",
|
|
14
|
+
"uWebSockets yarn",
|
|
15
|
+
"uWebSockets.js npm package",
|
|
16
|
+
"uWebSockets.js yarn package",
|
|
17
|
+
"fast websocket server",
|
|
12
18
|
"websockets",
|
|
19
|
+
"websocket server",
|
|
20
|
+
"fast websocket",
|
|
21
|
+
"fastest websocket npm",
|
|
22
|
+
"node.js websocket server",
|
|
23
|
+
"socket.io alternative",
|
|
24
|
+
"fastify alternative",
|
|
25
|
+
"pubsub websocket",
|
|
26
|
+
"C++ networking",
|
|
27
|
+
"low latency server",
|
|
28
|
+
"high performance websocket",
|
|
13
29
|
"socket",
|
|
14
30
|
"node.js",
|
|
15
|
-
"web",
|
|
16
31
|
"server",
|
|
17
32
|
"µwebsockets",
|
|
33
|
+
"µwebsockets npm package",
|
|
34
|
+
"µwebsockets yarn package",
|
|
18
35
|
"eventing",
|
|
19
36
|
"networking",
|
|
20
37
|
"encryption",
|
|
@@ -27,7 +44,13 @@
|
|
|
27
44
|
"C++.",
|
|
28
45
|
"fastify",
|
|
29
46
|
"websocket",
|
|
30
|
-
"
|
|
47
|
+
"uws",
|
|
48
|
+
"socket.IO.",
|
|
49
|
+
"npm uWebSockets",
|
|
50
|
+
"yarn uWebSockets",
|
|
51
|
+
"yarn uWebSockets.js",
|
|
52
|
+
"jkg",
|
|
53
|
+
"jaykumar-gohil"
|
|
31
54
|
],
|
|
32
55
|
"author": "",
|
|
33
56
|
"license": "ISC",
|
package/source_commit
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
b8704be92ff2b16c6dd44cc2b334158ab73eef2a
|