README.md in faye-websocket-0.7.5 vs README.md in faye-websocket-0.8.0

- old
+ new

@@ -7,11 +7,11 @@ This is a general-purpose WebSocket implementation extracted from the [Faye](http://faye.jcoglan.com) project. It provides classes for easily building WebSocket servers and clients in Ruby. It does not provide a server itself, but rather makes it easy to handle WebSocket connections within an -existing [Rack](http://rack.rubyforge.org/) application. It does not provide +existing [Rack](http://rack.github.io/) application. It does not provide any abstraction other than the standard [WebSocket API](http://dev.w3.org/html5/websockets/). It also provides an abstraction for handling [EventSource](http://dev.w3.org/html5/eventsource/) connections, which are @@ -23,11 +23,11 @@ `rack.hijack` API should also work. * [Goliath](http://postrank-labs.github.com/goliath/) * [Phusion Passenger](https://www.phusionpassenger.com/) >= 4.0 with nginx >= 1.4 * [Puma](http://puma.io/) >= 2.0 -* [Rainbows](http://rainbows.rubyforge.org/) +* [Rainbows](http://rainbows.bogomips.org/) * [Thin](http://code.macournoyer.com/thin/) ## Installation @@ -124,11 +124,23 @@ ``` The WebSocket client also lets you inspect the status and headers of the handshake response via its `status` and `headers` methods. +To connect via a proxy, set the `proxy` option to the HTTP origin of the proxy, +including any authorization information and custom headers you require: +```rb +ws = Faye::WebSocket::Client.new('ws://www.example.com/', nil, { + :proxy => { + :origin => 'http://username:password@proxy.example.com', + :headers => {'User-Agent' => 'ruby'} + } +}) +``` + + ## Subprotocol negotiation The WebSocket protocol allows peers to select and identify the application protocol to use over the connection. On the client side, you can set which protocols the client accepts by passing a list of protocol names when you @@ -303,32 +315,29 @@ ``` $ rackup config.ru -s thin -E production -p 9292 ``` It can also be started using the `Rack::Handler` interface common to many Ruby -servers. It must be run using EventMachine, and you can configure Thin further -in a block passed to `run`: +servers. You can configure Thin further in a block passed to `run`: ```ruby require 'eventmachine' require 'rack' require 'thin' require './app' Faye::WebSocket.load_adapter('thin') -EM.run { - thin = Rack::Handler.get('thin') +thin = Rack::Handler.get('thin') - thin.run(App, :Port => 9292) do |server| - # You can set options on the server here, for example to set up SSL: - server.ssl_options = { - :private_key_file => 'path/to/ssl.key', - :cert_chain_file => 'path/to/ssl.crt' - } - server.ssl = true - end -} +thin.run(App, :Port => 9292) do |server| + # You can set options on the server here, for example to set up SSL: + server.ssl_options = { + :private_key_file => 'path/to/ssl.key', + :cert_chain_file => 'path/to/ssl.crt' + } + server.ssl = true +end ``` ### Running the app with Passenger