diff options
author | 2023-05-22 12:29:10 -0700 | |
---|---|---|
committer | 2023-05-22 12:29:10 -0700 | |
commit | 82e762fe2f55a0dac7f545bf4494f94db9d72349 (patch) | |
tree | a90ba5a2e279b331e6b71503bf48de5ca144ff2f /src/bun.js/api/server.zig | |
parent | a5acf7bfa0333fc5cb298df2b3ea09eaa56075ac (diff) | |
download | bun-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.zig | 2 |
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 { |