alisyd

alisyd

Hello there, we have an app built with phoenix liveview which shows tick by tick market data for selected stocks every second, the app works fine on local network, but the websocket connection keeps disconnecting with 1006 when using a public IP or a reverse proxy. We have been trying to debug this for a while, any help is appreciated. Phoenix doesn’t reconnect when the websocket disconnect occurs, instead the entire page is reloaded again, even if we have turn off the code reloader

Showing Posts 1 to 3

Hermanverschooten

Hermanverschooten

Hi @alisyd

To answer the second part of your question first, live views are processes managed by a supervisor.
The supervisor restarts the process if it crashes, this is by design in OTP and is totally distant from the code reloading that happens in development.

If you say it keeps disconnecting, does this mean it does connect or never connects?
What is your setup? Are you connecting directly to the Phoenix app or is there a reverse-proxy or load-balancer or … in between?

What is in the log of the Phoenix app?

LostKobrakai

LostKobrakai

That‘s not fully correct. LiveViews are processes, yes, but they‘re not restarted by the supervisor. That doesn‘t make sense as the server has no way to connect back to the client with the websocket connection gone.

Given you mention the code reloader would this be with a dev build?

Generally you want to understand that there are two distinct tools in phoenix around keeping things up to date. There‘s the code reloader, which does track elixir source files and recompiles them if they have changed whenever a new (http) request comes in. So that cannot be what you‘re looking for.

There‘s also the live reloader, which reloads the website whenever templates or assets have changed. That one might be it.

alisyd

alisyd OP

thanks for the responding, turns out it was because of delayed replies to heartbeat message from js client, so heartbeat timeout occurs and liveView reconnects agains. And also this does not occur when connected to local network and the issue is more prominent when phoenix app is put behind a reverse proxy, and yes this is with a dev build, we have disabled code reloader. I am assuming this has something to do with the udp listener, I have in the application which listens for data from a different application. when I turn off the udp listener everything works fine, and also I am updating socket assigns, every second. udp listener is a genserver that listens for data over a port, I have put a large value for recbuf (65536), Idk if that is causing the issue.

— All posts loaded —

Where Next? Top

Trending in Questions Top

Blokh
Hey guys, I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly Do you guys have any suggestions what is the best prac...
New
kszambelanczyk
Hello! Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app. I creat...
New
Onor.io
I have what I’ve heard referred to as a “lookup table” in my database. This is a way of assigning codes to common values. One common lo...
New
Trolleger
What approach to take when sending live updates to “random” users Hi! I have a question, I have a little chat app, and when I create a DM...
New
matt-savvy
Anyone here using Honeybadger? My Honeybadger account is being overwhelmed with noise from some bots. Seeing a lot of Bandit.HTTPError...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
wintermeyer
There are three potential reasons for members of this forum to have a look at https://vutuv.de You are tired or annoyed of LinkedIn. Yo...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews