TMoore

TMoore

join crashed

Hello!

I’m working on incorporating the ingress capability of Home Assistant into an add-on that utilizes a websocket. The challenge is that the web application expects a base URL of / but the Home Assistant ingress feature uses a base URL of /api/hassio_ingress//. The web application utilizes a websocket at /live. I’ve setup NGINX to provide the necessary proxying and filtering in order to dynamically modify the URL references in the web application. This seems to work well for the main page, but there are two secondary pages that don’t work. When I look at the Messages for the websocket in the developer tools, I see that the websocket is sending a phx_reply with a “join crashed” error.

At this point, I’m hoping someone might have some ideas as to why it might work on the main page but not on the secondary pages.

Thanks!

First Post!

tcoopman

tcoopman

Can you provide the full error message and the relevant code?

Last Post!

TMoore

TMoore

The application is TeslaMate (GitHub - teslamate-org/teslamate: A self-hosted data logger for your Tesla 🚘 [main maintainer=@JakobLichterfeld] · GitHub). The prod.exs sets the root to “.”, which then causes all of the endpoints defined in the app to start at /. I’m basically looking for a way to dynamically change that root path.

Home Assistant provides a request header X-Ingress-Path that contains the root path that is actually used (e.g. /api/hassio_ingress/id_of_addon). As such, I’m looking a way to cause Phoenix to utilize that new root path in the artifacts that are generated.

I read about one possible solution of setting
X-Forwarded-Host to something like “localhost:8080/api/hassio_ingress/id_of_addon”. Would Phoenix process that in the way I’m looking for? If not, are there any other headers that Phoenix looks at that might cause it to change it’s root path?

Where Next?

Popular in Questions Top

electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
Lily
In templates/appointment/index.html.eex: <%= for appointment <- @appointments do %> <tr> <td><%= appoi...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New

Other popular topics Top

lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
saif
Hello everyone, Long time lurker first time poster here. I’ve recently begun working on Elixir full-time again! :raised_hands: It’s been...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New

We're in Beta

About us Mission Statement