YoungFlannagan

YoungFlannagan

Heroku Deployed Elm/Phoenix App Websocket Issue

Hi all,

I deployed my elm embedded phoenix application to heroku and it compiled successfully. The issue I am having is the websocket connection no longer works. I am using the elm-phoenix-socket package, and figured all I had to do was change the socket init url from “ws://localhost:4000/socket/websocket” to “wss://my-app.herokuapp.com/socket/websocket” I have tried a couple other urls to no avail.

Not sure what to try. Any help would be appreciated.

Most Liked

apoeco

apoeco

Can you try wss://my-app.herokuapp.com/socket instead?
I am not sure if this will work but the default url defined in the Endpoint module is "/socket"

OvermindDL1

OvermindDL1

Did you update the allowed incoming url’s in your configuration?

Most

Most

I ran into a similar problem and documented some of the different things I tried to fix it in this SO post.

I never got it to work properly and resorted to hard-coding my socket variable before pushing to production. If there’s a right way to accomplish this I’d love to know.

happysalada

happysalada

heroku gives an error about setting the check_origin parameter for me that did it

url: [scheme: “https”, host: “myapp.com”, port: 443],
check_origin: [
https://myapp.com”,
https://www.myapp.com
],

YoungFlannagan

YoungFlannagan

I have url: [scheme: "https", host: "secret-sea...herokuapp.com", port: 443] within my Endpoint config in prod.exs. Not sure if that is what you are referring to or not.

Where Next?

Popular in Questions Top

sergio
In Ruby, I can go: User.find_by(email: "foobar@email.com").update(email: "hello@email.com") How can I do something similar in Elixir? ...
New
dotdotdotPaul
Okay, I'm having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I'm sure I'...
New
pgiesin
This should be a simple problem but I just can’t seem to figure it out. I have a standalone Elixir app that won’t find the database. Dep...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod -- where is this set? Thanks.
New
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
New
vac
Hi, I'm quite new in Elixir and I'm trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and ...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers' Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New

Other popular topics Top

srinivasu
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call th...
New
dotdotdotPaul
Okay, I'm having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I'm sure I'...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 35421 110
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
mgjohns61585
Could someone help me? I'm making my first elixir program, number guessing game. I can't figure out how to convert the user's guess from ...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New

We're in Beta

About us Mission Statement