summaryrefslogtreecommitdiff
path: root/ext/http/01_http.js
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2023-04-06 18:44:31 +0530
committerGitHub <noreply@github.com>2023-04-06 18:44:31 +0530
commit4cc8784f5b3a71b2a882ff359d593b4b74c9e89b (patch)
tree16c398325e76a7fbf4ac87f1ca9a82778e3dabca /ext/http/01_http.js
parent3b62a58818f83e32fc2644f44e75a5c8465b2003 (diff)
perf(ext/websocket): replace tokio_tungstenite server with fastwebsockets (#18587)
https://github.com/littledivy/fastwebsockets ``` # This PR ./load_test 100 0.0.0.0 8080 0 0 Running benchmark now... Msg/sec: 176355.000000 # main ./load_test 100 0.0.0.0 8080 0 0 Running benchmark now... Msg/sec: 157198.750000 ```
Diffstat (limited to 'ext/http/01_http.js')
-rw-r--r--ext/http/01_http.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/http/01_http.js b/ext/http/01_http.js
index d0aefc0c3..51347ebed 100644
--- a/ext/http/01_http.js
+++ b/ext/http/01_http.js
@@ -26,8 +26,10 @@ import {
_protocol,
_readyState,
_rid,
+ _role,
_server,
_serverHandleIdleTimeout,
+ SERVER,
WebSocket,
} from "ext:deno_websocket/01_websocket.js";
import { listen, TcpConn, UnixConn } from "ext:deno_net/01_net.js";
@@ -376,6 +378,7 @@ function createRespondWith(
httpConn.close();
ws[_readyState] = WebSocket.OPEN;
+ ws[_role] = SERVER;
const event = new Event("open");
ws.dispatchEvent(event);