tonyc / open890

A web-based remote UI for the Kenwood TS-890.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"Could not check origin for Phoenix.Socket transport" error

tonyc opened this issue · comments

Thread reference: https://groups.io/g/open890/topic/could_not_check_origin_for/87645781

mikko@asus890server:~/open890$ ./open890.sh 
20:24:34.052 [info] Running Open890Web.Endpoint with cowboy 2.9.0 at :::4000 (http)
20:24:34.058 [info] Access Open890Web.Endpoint at http://localhost:4000
                       ___ ___  ___
   ___  ___  ___ ___  ( _ ) _ \/ _ \
  / _ \/ _ \/ -_) _ \/ _  \_, / // /
  \___/ .__/\__/_//_/\___/___/\___/
     /_/
 
  open890 is now running.
  Access the web interface at http://localhost:4000
 
20:25:43.358 request_id=Fr9-j08WufFryD8AAABR [info] GET /
20:25:43.358 request_id=Fr9-j08WufFryD8AAABR [info] Sent 302 in 306µs
20:25:43.364 request_id=Fr9-j09o3yg467UAAABh [info] GET /connections
20:25:43.397 request_id=Fr9-j09o3yg467UAAABh [info] Sent 200 in 33ms
20:25:43.595 [error] Could not check origin for Phoenix.Socket transport.
 
Origin of the request: http://asus890server:4000
 
This happens when you are attempting a socket connection to
a different host than the one configured in your config/
files. For example, in development the host is configured
to "localhost" but you may be trying to access it from
"127.0.0.1". To fix this issue, you may either:
 
  1. update [url: [host: ...]] to your actual host in the
     config file for your current environment (recommended)
 
  2. pass the :check_origin option when configuring your
     endpoint or when configuring the transport in your
     UserSocket module, explicitly outlining which origins
     are allowed:
 
        check_origin: ["https://example.com",
                       "//another.com:888", "//other.com"]

I think the solution here is to allow the url host to be set via an environment var, something like URL_HOST