mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 18:18:55 +00:00
fix(portal): Decrease WS timeouts for relays and gateways (#6112)
Related to #6095
This commit is contained in:
@@ -24,9 +24,9 @@ defmodule API.Endpoint do
|
||||
# https://hexdocs.pm/phoenix/Phoenix.Logger.html
|
||||
plug Plug.Telemetry, event_prefix: [:phoenix, :endpoint]
|
||||
|
||||
socket "/gateway", API.Gateway.Socket, API.Sockets.options()
|
||||
socket "/client", API.Client.Socket, API.Sockets.options()
|
||||
socket "/relay", API.Relay.Socket, API.Sockets.options()
|
||||
socket "/gateway", API.Gateway.Socket, API.Sockets.options(timeout: :timer.seconds(37))
|
||||
socket "/client", API.Client.Socket, API.Sockets.options(timeout: :timer.seconds(307))
|
||||
socket "/relay", API.Relay.Socket, API.Sockets.options(timeout: :timer.seconds(41))
|
||||
|
||||
plug :fetch_user_agent
|
||||
plug API.Router
|
||||
|
||||
@@ -5,15 +5,18 @@ defmodule API.Sockets do
|
||||
"""
|
||||
require Logger
|
||||
|
||||
def options do
|
||||
def options(websocket_overrides \\ []) do
|
||||
[
|
||||
websocket: [
|
||||
timeout: :timer.seconds(307),
|
||||
transport_log: :debug,
|
||||
check_origin: :conn,
|
||||
connect_info: [:trace_context_headers, :user_agent, :peer_data, :x_headers],
|
||||
error_handler: {__MODULE__, :handle_error, []}
|
||||
],
|
||||
websocket:
|
||||
Keyword.merge(
|
||||
[
|
||||
transport_log: :debug,
|
||||
check_origin: :conn,
|
||||
connect_info: [:trace_context_headers, :user_agent, :peer_data, :x_headers],
|
||||
error_handler: {__MODULE__, :handle_error, []}
|
||||
],
|
||||
websocket_overrides
|
||||
),
|
||||
longpoll: false
|
||||
]
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user