Allow websockets through multiple hostnames

This commit is contained in:
Mike Cifelli 2024-05-29 19:02:10 -04:00
parent 86d3808e54
commit dc481bd6aa
Signed by: mike
GPG Key ID: 6B08C6BE47D08E4C
1 changed files with 3 additions and 1 deletions

View File

@ -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.