简体   繁体   English

Heroku上具有SSL的WebSockets-Chrome和FireFox中的问题

[英]WebSockets with SSL on Heroku - issues in Chrome and FireFox

I have a chat application hosted on Heroku that is using WebSockets. 我在使用WebSockets的Heroku上托管了一个聊天应用程序。 The app is Rails 4.0.1 and Ruby 2.0.0 and is using the gem 'websocket-rails'. 该应用程序是Rails 4.0.1和Ruby 2.0.0,并使用gem'websocket-rails'。

The application was working fine in Safari, Chrome and Firefox when I was using standard http://. 当我使用标准的http://时,该应用程序在Safari,Chrome和Firefox中运行良好。 Then today I added SSL endpoint on Heroku. 然后今天我在Heroku上添加了SSL端点。 Now, the app works fine in Safari, but in Chrome and Firefox it will take > 1 minute to load any page (even just a static page). 现在,该应用程序可以在Safari上正常运行,但是在Chrome和Firefox中,加载任何页面(甚至只是静态页面)都需要1分钟以上的时间。 It is getting hung up on something (I'm guessing the WebSocket connection) but I am having a hard time debugging the root problem. 它正挂在某种东西上(我猜是WebSocket连接),但是我很难调试根本问题。 Any ideas or things to try would be greatly appreciated. 任何想法或尝试尝试将不胜感激。

The app is: http://www.chat-correct.com . 该应用程序是: http : //www.chat-c​​orrect.com If you try it in Safari it should load the pages relatively fast, but if you try it in Chrome or Firefox you will see that it hangs. 如果您在Safari中尝试它,它应该会相对较快地加载页面,但是如果您在Chrome或Firefox中尝试它,则将挂起。

I am using: Safari Version 6.1 (8537.71) 我正在使用:Safari版本6.1(8537.71)
Chrome Version 31.0.1650.39 beta Chrome版本31.0.1650.39 Beta
Firefox Version 22 Firefox 22版

UPDATE 更新

I have narrowed the issue down and it seems to be with using the thin web server: 我缩小了范围,这似乎与使用瘦Web服务器有关:
Thin web server (v1.6.1 codename Death Proof) 瘦Web服务器(v1.6.1代号死亡证明)

If I switch the app to WEBrick, the Chrome/Firefox issue disappears. 如果我将应用程序切换到WEBrick,Chrome / Firefox问题将消失。 However, the web socket-rails gem doesn't work with WEBrick and only seems to support only event machine based web servers (thus Unicorn/Puma is out of the question). 但是,Web socket-rails gem无法与WEBrick一起使用,并且似乎仅支持基于事件机的Web服务器(因此,Unicorn / Puma毫无疑问)。

Try Rainbows!. 尝试Rainbows!。 http://rainbows.rubyforge.org/ It is based on unicorn and also can be configured to use EventMachine for network concurrency. http://rainbows.rubyforge.org/它基于独角兽,还可以配置为使用EventMachine进行网络并发。 Though to be fair, I ran into your question because I have a similar issue on rainbows. 公平地说,我遇到了您的问题,因为我在彩虹问题上也遇到了类似的问题。 Anyway, I have a slightly different setup so it may not be an issue for you. 无论如何,我的设置略有不同,因此对您来说可能不是问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM