开发者

HTTP Streaming on Heroku with Rails 3.1 & Unicorn

开发者 https://www.devze.com 2023-03-31 07:58 出处:网络
Inspired by the RailsCast on HTTP Streaming, I\'ve decided to turn it on on my server. However, the listen 3000 :tcp_nopush => false line that Ryan suggests adding to my unicorn.rb doesn\'t play we

Inspired by the RailsCast on HTTP Streaming, I've decided to turn it on on my server. However, the listen 3000 :tcp_nopush => false line that Ryan suggests adding to my unicorn.rb doesn't play well with Heroku (they don't let you specify a port). Is streaming supported on Her开发者_开发问答oku, and how do I turn it on?


Heroku tells your application what port to listen on via the environment variable PORT. Check for this environment variable in your unicorn.rb.

port = ENV["PORT"].to_i
listen port, :tcp_nopush => false
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号