Reputation: 1182
I'm trying to create a websocket connection to my Phoenix app from an Android client. I'm trying to use this library but I'm running into this issue and I'm unable to successfully join a channel.
Upon reviewing the source code of the above java phoenix client library, it looks like the initial request from the client to connect to the socket is made with http
schema and not ws
(the source code explicitly changes the provided url to make sure it always uses http
). It's not clear to me how this would work without additional configuration in my Phoenix app: if a socket connect request is made to http://localhost:4000/socket
, the request will fail because there is no route for /socket
when the schema is http
.
There's nothing in the library docs that says any additional config is required in my Phoenix app to make this work, but I don't see how it could work for the reason stated above.
Does a Phoenix app have built in handling for the connection upgrade, etc, required on handshake as specified here?
As a note, I have no issues making websocket connections from my javascript web client to my Phoenix backend.
Any suggestions are appreciated!
Upvotes: 0
Views: 759
Reputation: 1
Have you tried using the default path for a channel http://localhost:4000/socket/websocket
?
Upvotes: 0