aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/api/server.classes.ts
diff options
context:
space:
mode:
authorGravatar Ashcon Partovi <ashcon@partovi.net> 2023-07-13 09:39:43 -0700
committerGravatar GitHub <noreply@github.com> 2023-07-13 09:39:43 -0700
commit9eb8eea2a81be6a20abb62544dc54a35ff4173a5 (patch)
tree63ab7bc037477b0db836067ac6c49c273d251353 /src/bun.js/api/server.classes.ts
parent04b4157232006c882cdd693f566b31945618b924 (diff)
downloadbun-9eb8eea2a81be6a20abb62544dc54a35ff4173a5.tar.gz
bun-9eb8eea2a81be6a20abb62544dc54a35ff4173a5.tar.zst
bun-9eb8eea2a81be6a20abb62544dc54a35ff4173a5.zip
Implement `ping()`, `pong()`, `terminate()` for WebSocket client and server (#3257)
Diffstat (limited to 'src/bun.js/api/server.classes.ts')
-rw-r--r--src/bun.js/api/server.classes.ts21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/bun.js/api/server.classes.ts b/src/bun.js/api/server.classes.ts
index b3d174957..3aaea871f 100644
--- a/src/bun.js/api/server.classes.ts
+++ b/src/bun.js/api/server.classes.ts
@@ -45,7 +45,6 @@ export default [
args: ["JSUint8Array", "bool"],
},
},
-
publishText: {
fn: "publishText",
length: 2,
@@ -62,10 +61,21 @@ export default [
args: ["JSString", "JSUint8Array"],
},
},
-
+ ping: {
+ fn: "ping",
+ length: 1,
+ },
+ pong: {
+ fn: "pong",
+ length: 1,
+ },
close: {
fn: "close",
- length: 1,
+ length: 3,
+ },
+ terminate: {
+ fn: "terminate",
+ length: 0,
},
cork: {
fn: "cork",
@@ -103,11 +113,6 @@ export default [
fn: "isSubscribed",
length: 1,
},
-
- // topics: {
- // getter: "getTopics",
- // },
-
remoteAddress: {
getter: "getRemoteAddress",
cache: true,