阅读背景:

Rails Heroku Cloudflare SSL和websockets

来源:互联网 

I have set up my Rails app on Heroku and used the information in the post: Heroku + Cloudflare completely free SSL to get SSL working for free, but my websockets connection does not work. I get the error WebSocket connection to 'wss://www.myapp.com/websocket' failed: Error during WebSocket handshake: Unexpected response code: 200. I understand that this is due to Cloudflare not supporting websockets in their free plans and they suggest setting up a subdomain that does not pass through Cloudflare. The problem of course is that the subdomain cannot then use the 'free' SSL setup.

我已经在Heroku上设置了我的Rails应用程序并使用了帖子中的信息:Heroku + Cloudflare完全免费的SSL以使SSL免费工作,但我的websockets连接不起作用。我得到错误WebSocket连接到'wss://www.myapp.com/websocket'失败:WebSocket握手期间出错:意外的响应代码:200。我知道这是因为Cloudflare在他们的免费计划中不支持websockets并且他们建议设置一个不通过Cloudflare的子域。问题当然是子域不能使用'免费'SSL设置。

Is there anyway I can get this to work, or do I have to shell out for either SSL support on Heroku or Websocket support on Cloudflare?

无论如何我可以使用它,或者我必须支持Heroku上的SSL支持或Cloudflare上的Websocket支持吗?

1 个解决方案

#1


0  

I know this is an old thread.

我知道这是一个老话题。

But now cloudflare supports websocket for free plan as well. It just restricts the ports which can be used.

但是现在cloudflare也支持websocket免费计划。它只是限制了可以使用的端口。

I recently encountered this situation and could implement the websockets through cloudflare. Can refer my approach here

我最近遇到过这种情况,可以通过cloudflare实现websockets。可以参考我的方法

May help someone.

可以帮助别人。


分享到: