Skip to content

Commit af5ba33

Browse files
committed
- config: use correct default port for http broadcasts
1 parent 33c1213 commit af5ba33

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/anycable/config.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def usages
5555
nats_options: {},
5656

5757
### HTTP broadcasting options
58-
http_broadcast_url: "http://localhost:8090/_broadcast",
58+
http_broadcast_url: nil,
5959
# DEPRECATED: use `broadcast_key` instead
6060
http_broadcast_secret: nil,
6161

@@ -101,6 +101,11 @@ def http_health_port_provided?
101101
!http_health_port.nil? && http_health_port != ""
102102
end
103103

104+
def http_broadcast_url
105+
# AnyCable accepts broadcast on a different port by default when no authentication configured
106+
super || (broadcast_key! ? "http://localhost:8080/_broadcast" : "http://localhost:8090/_broadcast")
107+
end
108+
104109
def broadcast_key!
105110
if http_broadcast_secret && !broadcast_key
106111
self.broadcast_key ||= http_broadcast_secret

0 commit comments

Comments
 (0)