lib/faye/websocket/client.rb in faye-websocket-0.10.8 vs lib/faye/websocket/client.rb in faye-websocket-0.10.9

- old
+ new

@@ -5,11 +5,11 @@ class Client extend Forwardable include API - DEFAULT_PORTS = {'http' => 80, 'https' => 443, 'ws' => 80, 'wss' => 443} + DEFAULT_PORTS = { 'http' => 80, 'https' => 443, 'ws' => 80, 'wss' => 443 } SECURE_PROTOCOLS = ['https', 'wss'] def_delegators :@driver, :headers, :status def initialize(url, protocols = nil, options = {}) @@ -27,11 +27,11 @@ EventMachine.connect(endpoint.host, port, Connection) do |conn| conn.parent = self end rescue => error - emit_error("Network error: #{url}: #{error.message}") + emit_error("Network error: #{ url }: #{ error.message }") finalize_close end private @@ -49,11 +49,11 @@ uri = URI.parse(@url) secure = SECURE_PROTOCOLS.include?(uri.scheme) @proxy = nil if secure - origin_tls = {:sni_hostname => uri.host}.merge(@origin_tls) + origin_tls = { :sni_hostname => uri.host }.merge(@origin_tls) @stream.start_tls(origin_tls) end @driver.start end @@ -61,10 +61,10 @@ def on_connect(stream) @stream = stream if @secure - socket_tls = {:sni_hostname => URI.parse(@url).host}.merge(@socket_tls) + socket_tls = { :sni_hostname => URI.parse(@url).host }.merge(@socket_tls) @stream.start_tls(socket_tls) end worker = @proxy || @driver worker.start