Websocket不能在heroku中使用socket.io

我的应用程序工作正常与socket.io使用websockets和xhr-polling本地主机,它与heroku中的xhr-polling工作,但由于heroku提供了对websocket的支持,我不能使用websockets工作。

我的Chrome控制台显示以下消息:

WebSocket connection to 'ws://<myherokuapp>.herokuapp.com/socket.io/1/websocket/HBWE2BFvHahlSWk5ppHP' failed: Unexpected response code: 503 

我已经启用websocket实验室。

是否有使用socket.io的websocket的任何工作的例子?

我有同样的问题,只是通过重新激活我的应用程序在heroku 上的websockets修复它。 由于某种原因,它刚刚随机切换到XHR轮询。

我从heroku的网站(@ https://devcenter.heroku.com/articles/heroku-labs-websockets )使用这个命令重新激活它:

heroku labs:enable websockets -a myapp

然后我重新启动我的服务器推送到heroku并重build(或使用: heroku restart )。

我也有一个非常基本的socket.io聊天应用程序(由Smitha Milli编写)的工作副本,您可以在http://calm-gorge-8474.herokuapp.com/上进行testing&#x3002;

希望这可以帮助!