HTTP streaming to Heroku with Rails 3.1 and Unicorn

Inspired by RailsCast on HTTP Streaming , I decided to enable it on my server. However, the listen 3000 :tcp_nopush => false line listen 3000 :tcp_nopush => false , which Ryan suggests adding to my unicorn.rb , does not work very well with Heroku (they do not allow you to specify a port). Is streaming supported on Heroku and how to enable it?

+4
source share
1 answer

Heroku tells your application which port to listen on through the PORT environment variable. Check out this environment variable in unicorn.rb .

 port = ENV["PORT"].to_i listen port, :tcp_nopush => false 
+9
source

Source: https://habr.com/ru/post/1369526/


All Articles