aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/api/server.zig
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-05-22 12:29:10 -0700
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-05-22 12:29:10 -0700
commit82e762fe2f55a0dac7f545bf4494f94db9d72349 (patch)
treea90ba5a2e279b331e6b71503bf48de5ca144ff2f /src/bun.js/api/server.zig
parenta5acf7bfa0333fc5cb298df2b3ea09eaa56075ac (diff)
downloadbun-82e762fe2f55a0dac7f545bf4494f94db9d72349.tar.gz
bun-82e762fe2f55a0dac7f545bf4494f94db9d72349.tar.zst
bun-82e762fe2f55a0dac7f545bf4494f94db9d72349.zip
[breaking] ServerWebSocket.publish no longer publishes to self by default
This changes `publishToSelf` to be `false` by default instead of `true`. This is a breaking change because it means that `ws.publish("foo", "bar")` will exclude `ws` from the list of websockets to broadcast. We are making this change because many people asked for this and were confused by the status quo - that `w.publish` publishes to self.
Diffstat (limited to 'src/bun.js/api/server.zig')
-rw-r--r--src/bun.js/api/server.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bun.js/api/server.zig b/src/bun.js/api/server.zig
index 2ce7347c0..463e26c0a 100644
--- a/src/bun.js/api/server.zig
+++ b/src/bun.js/api/server.zig
@@ -2980,7 +2980,7 @@ pub const WebSocketServer = struct {
/// used by publish()
flags: packed struct(u2) {
ssl: bool = false,
- publish_to_self: bool = true,
+ publish_to_self: bool = false,
} = .{},
pub fn fromJS(globalObject: *JSC.JSGlobalObject, object: JSC.JSValue) ?Handler {