title: Rails using Websockets with Nginx and Unicorn?
body: <p>I am considering implementing chess (which needs websockets) with Rails, and in production deployment using Nginx as a reverse proxy to a bunch of Unicorn processes.</p>
  
  <p>In thinking about how to make that work led me to have the following questions:</p>
  
  <p>As far as I understand websockets are a persistent connection. Since everything goes through the reverse proxy Nginx how exactly would a Unicorn worker process maintain a websocket connection to a client browser? Would Nginx maintain state about which Unicorn process each browser websocket is connected to and act as a kind of intermediary? Does keeping a persistent websocket connection in a Unicorn process block the entire worker process?</p>
  
  <p>Is there a recommended way to implementing chess (with websockets) using Rails?</p>