lib/faye/websocket/client.rb in faye-websocket-0.10.0 vs lib/faye/websocket/client.rb in faye-websocket-0.10.1
- old
+ new
@@ -8,20 +8,18 @@
SECURE_PROTOCOLS = ['https', 'wss']
attr_reader :headers, :status
def initialize(url, protocols = nil, options = {})
- @url = url
- @driver = ::WebSocket::Driver.client(self, :max_length => options[:max_length], :protocols => protocols)
+ @url = url
+ super(options) { ::WebSocket::Driver.client(self, :max_length => options[:max_length], :protocols => protocols) }
[:open, :error].each do |event|
@driver.on(event) do
@headers = @driver.headers
@status = @driver.status
end
end
-
- super(options)
proxy = options.fetch(:proxy, {})
endpoint = URI.parse(proxy[:origin] || @url)
port = endpoint.port || DEFAULT_PORTS[endpoint.scheme]
@secure = SECURE_PROTOCOLS.include?(endpoint.scheme)