WebSockets on Phusion Passenger
This application demonstrates WebSocket support in Phusion Passenger. Passenger supports all major modern web technologies, such as WebSockets, entirely out of the box. You don't have to do anything: WebSocket support just works.
More information about Passenger:
Clone this repository, install the gem bundle and start Passenger Standalone.
git clone https://github.com/phusion/passenger-ruby-websocket-demo.git cd passenger-ruby-websocket-demo bundle install bundle exec passenger start
Access the demo application at http://0.0.0.0:3000/ and see it in action.
If you deploy this demo to production, be sure to enable sticky sessions in Passenger.
- This app uses plain Rack, and thus is framework agnostic.
- WebSockets work on Passenger for Nginx and Passenger Standalone. Apache is currently not supported.
- At least version 5.0.25 of Passenger is required.
- Only the RFC 6455 version of the WebSocket protocol is supported.
Tuning Passenger for WebSockets
WebSockets work great on both the open source variant of Phusion Passenger, as well as on Phusion Passenger Enterprise. But you need to tune a few settings. Please refer to the following places in the Passenger Library for more information:
- Tuning for Server Sent Events and WebSockets: Passenger + Nginx
- Tuning for Server Sent Events and WebSockets: Passenger + Apache
- Tuning for Server Sent Events and WebSockets: Passenger Standalone
This demo already contains tuning parameters for Passenger Standalone inside Passengerfile.json.
- Using WebSockets on Phusion Passenger? Tweet about us, follow us on Twitter or fork us on Github.
- Having problems? Please post a message at the community discussion forum.
Please enjoy Phusion Passenger, a product by Phusion. :-)