From dc481bd6aa7668ac3db9e75b2fbdf590690d4f3e Mon Sep 17 00:00:00 2001 From: Mike Cifelli Date: Wed, 29 May 2024 19:02:10 -0400 Subject: [PATCH] Allow websockets through multiple hostnames --- config/runtime.exs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/runtime.exs b/config/runtime.exs index 4f5bfd6..7f2dca0 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -33,13 +33,15 @@ if config_env() == :prod do You can generate one by calling: mix phx.gen.secret """ - host = System.get_env("PHX_HOST") || "example.com" + host = System.get_env("PHX_HOST") || "localhost" + aux_host = System.get_env("PHX_AUX_HOST") || host port = String.to_integer(System.get_env("PORT") || "4000") config :chronoscope, :dns_cluster_query, System.get_env("DNS_CLUSTER_QUERY") config :chronoscope, ChronoscopeWeb.Endpoint, url: [host: host, port: 443, scheme: "https"], + check_origin: ["https://" <> host, "https://" <> aux_host], http: [ # Enable IPv6 and bind on all interfaces. # Set it to {0, 0, 0, 0, 0, 0, 0, 1} for local network only access.