I have pushed a Phoenix app to Heroku and it is running fine, apart from connecting to a channel from iOS.
Channels over the browser work as expected.
In iOS I am using PhoenixWebSocket, and in dev env, connecting to the local Phoenix app works as expected.
The problem I am getting is when I point the web socket url to the Heroku app I get the following error:
Error Domain=WebSocket Code=301 "Invalid HTTP upgrade" UserInfo={NSLocalizedDescription=Invalid HTTP upgrade}
Looking around for the error message earlier today, I found a post from Chris McCord, I think it was, saying that this error message is a result of the server refusing to upgrade the request.
However, I've looked around Heroku and found that; Websockets functionality is supported for all applications.
So I'm confused as to whether my problem is on the iOS side, or the Heroku side.
I have pushed Chris's example chat application to Heroku, and tried to connect with the demo app that comes with PhoenixWebSocket, but get the same error.
Has anyone else managed to get web socket requests working between iOS and Heroku hosting a Phoenix app?
Would anyone know if there is something differently I need to do with the request in iOS before trying to join the channel? Or, maybe there is something with the Heroku setup relating to web sockets that I've missed?
The url for the request in iOS:
let url = NSURL(string: "ws://app-name-32793.heroku.com/socket/websocket")!
Many thanks to anyone that can help, and please let me know if there's anything else I can supply to help.
Paul