Skip to content

Commit 743a528

Browse files
authored
Merge pull request #148 from Accenture/fix-sse-timeout
Remove SSE 60s timeout (cowboy 2.0's idle_timeout & inactivity_timeout)
2 parents 3230f8a + 4fa6e25 commit 743a528

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515

1616
<!-- ### Removed -->
1717

18-
<!-- ### Fixed -->
18+
### Fixed
19+
20+
- A library upgrade caused idle SSE connections to time out after 60 seconds. This timeout is now disabled.
1921

2022
<!-- ### Security -->
2123

apps/rig_inbound_gateway/config/config.exs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ ranch_transport_options = [
2424
max_connections: :infinity
2525
]
2626

27+
cowboy_options = [
28+
idle_timeout: :infinity,
29+
inactivity_timeout: :infinity,
30+
# Experimental feature that allows using WebSocket over HTTP/2:
31+
enable_connect_protocol: true
32+
]
33+
2734
cowboy_dispatch = [
2835
{:_,
2936
[
@@ -40,6 +47,7 @@ config :rig_inbound_gateway, RigInboundGatewayWeb.Endpoint,
4047
http: [
4148
port: {:system, :integer, "INBOUND_PORT", 4000},
4249
dispatch: cowboy_dispatch,
50+
protocol_options: cowboy_options,
4351
transport_options: ranch_transport_options
4452
],
4553
https: [
@@ -50,6 +58,7 @@ config :rig_inbound_gateway, RigInboundGatewayWeb.Endpoint,
5058
keyfile: "cert/selfsigned_key.pem",
5159
password: {:system, "HTTPS_KEYFILE_PASS", ""},
5260
dispatch: cowboy_dispatch,
61+
protocol_options: cowboy_options,
5362
transport_options: ranch_transport_options
5463
],
5564
render_errors: [view: RigInboundGatewayWeb.ErrorView, accepts: ~w(html json xml)],

0 commit comments

Comments
 (0)