# Phoenix LiveView constantly refreshes with custom domain

**URL:** <https://community.fly.io/t/phoenix-liveview-constantly-refreshes-with-custom-domain/3384>\
**Category:** Phoenix\
**Tags:** elixir\
**Created:** [December 10, 2021, 5:48am UTC](https://community.fly.io/t/phoenix-liveview-constantly-refreshes-with-custom-domain/3384 "2021-12-10T05:48:48Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![chrismccord](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/chrismccord/32/50976_2.png) [@chrismccord](https://community.fly.io/u/chrismccord)\
**Post date:** [December 10, 2021, 2:02pm UTC](https://community.fly.io/t/phoenix-liveview-constantly-refreshes-with-custom-domain/3384/3 "2021-12-10T14:02:58Z")

</div>

To expand on this, Phoenix enforces same origin for websockets by default, (`check_origin: true` endpoint config). By default, we will enforce the same origin as configured in your `:url`, but you can also provide a list of hosts if you have other needs. For example:

```auto
config :my_app, MyAppWeb.Endpoint,
  check_origin: ["//example.com", "//another.com"]

```

For applications generated with `phx.new` \>= 1.6.3, the `config/runtime.exs` will use a `PHX_HOST` environment export if available to set the endpoint url host, and `fly.toml` which is set to `myapp.fly.dev` when you run `fly launch`, and can be customized as you add your custom domains. Glad you got things sorted and hope that helps!

---

_[View the full topic](https://community.fly.io/t/phoenix-liveview-constantly-refreshes-with-custom-domain/3384)._
