faye-websocket 0.10.7 → 0.10.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of faye-websocket might be problematic. Click here for more details.
- checksums.yaml +5 -5
- data/CHANGELOG.md +63 -52
- data/README.md +40 -69
- data/examples/autobahn_client.rb +6 -4
- data/examples/client.rb +0 -1
- data/examples/config.ru +0 -1
- data/examples/proxy_server.rb +0 -1
- data/examples/server.rb +1 -2
- data/lib/faye/websocket/api.rb +9 -5
- data/lib/faye/websocket/client.rb +25 -23
- metadata +6 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 628a479aab315c020df8a057cf2533e2b2572b92cd81cdaff4006eae24ac3200
|
4
|
+
data.tar.gz: 0df9233725d24bf5ce905090b99271bcd4f47d598eb98912d9eef810cec950be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 439970962dd6c8198885d242d3165dde1f1d41c81e5b0ac2f11be97fa45e8f73d89cf94a97ef2f53521515a048bd2300357396645261609c63905a82cc7af55e
|
7
|
+
data.tar.gz: 8dffa7a809059080bf01c07104936c7b25dafc40e7a9e57782438c685ed9c686c2771d7d784863861395b75a4887e9ef5358b325007fa5200a5c4819903fc84f
|
data/CHANGELOG.md
CHANGED
@@ -1,161 +1,172 @@
|
|
1
|
+
### 0.10.8 / 2019-06-10
|
2
|
+
|
3
|
+
- In the case of a close timeout, don't block on waiting for writing to the
|
4
|
+
socket to complete
|
5
|
+
- Fix a race condition that caused a timeout not to be cancelled immediately
|
6
|
+
when the WebSocket is closed
|
7
|
+
|
1
8
|
### 0.10.7 / 2017-02-22
|
2
9
|
|
3
|
-
|
10
|
+
- Emit an error if `EventMachine::Connection#unbind` is called with an error
|
4
11
|
|
5
12
|
### 0.10.6 / 2017-01-22
|
6
13
|
|
7
|
-
|
14
|
+
- Forcibly close the I/O stream after a timeout if the peer does not respond
|
8
15
|
after calling `close()`
|
9
16
|
|
10
17
|
### 0.10.5 / 2016-11-12
|
11
18
|
|
12
|
-
|
19
|
+
- Set the SNI hostname when making secure requests
|
13
20
|
|
14
21
|
### 0.10.4 / 2016-05-20
|
15
22
|
|
16
|
-
|
23
|
+
- Amend warnings issued when running with -W2
|
17
24
|
|
18
25
|
### 0.10.3 / 2016-02-24
|
19
26
|
|
20
|
-
|
27
|
+
- Use `PATH_INFO` and `QUERY_STRING` rather than the non-standard `REQUEST_URI`
|
28
|
+
from the Rack env
|
21
29
|
|
22
30
|
### 0.10.2 / 2015-11-26
|
23
31
|
|
24
|
-
|
32
|
+
- Fix the `headers` and `status` methods on `Client`, which were broken in the
|
25
33
|
last release
|
26
34
|
|
27
35
|
### 0.10.1 / 2015-11-06
|
28
36
|
|
29
|
-
|
30
|
-
|
37
|
+
- Make sure errors can be safely emitted if creating the driver fails
|
38
|
+
- Prevent a race condition when binding `EM.attach` to the socket
|
31
39
|
|
32
40
|
### 0.10.0 / 2015-07-08
|
33
41
|
|
34
|
-
|
42
|
+
- Add the standard `code` and `reason` parameters to the `close` method
|
35
43
|
|
36
44
|
### 0.9.2 / 2014-12-21
|
37
45
|
|
38
|
-
|
46
|
+
- Only emit `error` once, and don't emit it after `close`
|
39
47
|
|
40
48
|
### 0.9.1 / 2014-12-18
|
41
49
|
|
42
|
-
|
50
|
+
- Check that all options to the WebSocket constructor are recognized
|
43
51
|
|
44
52
|
### 0.9.0 / 2014-12-13
|
45
53
|
|
46
|
-
|
54
|
+
- Allow protocol extensions to be passed into websocket-extensions
|
47
55
|
|
48
56
|
### 0.8.0 / 2014-11-08
|
49
57
|
|
50
|
-
|
58
|
+
- Support connections via HTTP proxies
|
51
59
|
|
52
60
|
### 0.7.5 / 2014-10-04
|
53
61
|
|
54
|
-
|
62
|
+
- Allow sockets to be closed when they are in any state other than `CLOSED`
|
55
63
|
|
56
64
|
### 0.7.4 / 2014-07-06
|
57
65
|
|
58
|
-
|
59
|
-
|
60
|
-
|
66
|
+
- Stop using `define_method` to implement `Event` properties, since it blows the
|
67
|
+
method cache
|
68
|
+
- Stop setup errors masking URI errors in `Client#initialize`
|
69
|
+
- Make the Goliath adapter compatible with goliath-1.0.4.
|
61
70
|
|
62
71
|
### 0.7.3 / 2014-04-24
|
63
72
|
|
64
|
-
|
73
|
+
- Remove an unneeded method override in the `WebSocket` class
|
65
74
|
|
66
75
|
### 0.7.2 / 2013-12-29
|
67
76
|
|
68
|
-
|
77
|
+
- Fix WebSocket detection in cases where the web server does not produce an
|
78
|
+
`env`
|
69
79
|
|
70
80
|
### 0.7.1 / 2013-12-03
|
71
81
|
|
72
|
-
|
73
|
-
|
82
|
+
- Support the `max_length` websocket-driver option
|
83
|
+
- Expose a `message` property on `error` events
|
74
84
|
|
75
85
|
### 0.7.0 / 2013-09-09
|
76
86
|
|
77
|
-
|
87
|
+
- Allow the server to send custom headers with EventSource responses
|
78
88
|
|
79
89
|
### 0.6.3 / 2013-08-04
|
80
90
|
|
81
|
-
|
91
|
+
- Stop implicitly depending on Rack 1.4
|
82
92
|
|
83
93
|
### 0.6.2 / 2013-07-05
|
84
94
|
|
85
|
-
|
95
|
+
- Catch errors thrown by EventMachine and emit `error` and `close` events
|
86
96
|
|
87
97
|
### 0.6.1 / 2013-05-12
|
88
98
|
|
89
|
-
|
99
|
+
- Release a gem without log and pid files in it
|
90
100
|
|
91
101
|
### 0.6.0 / 2013-05-12
|
92
102
|
|
93
|
-
|
103
|
+
- Add support for custom headers
|
94
104
|
|
95
105
|
### 0.5.0 / 2013-05-05
|
96
106
|
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
107
|
+
- Extract the protocol handlers into the `websocket-driver` library
|
108
|
+
- Support the `rack.hijack` API
|
109
|
+
- Add support for Rainbows 4.5 and Puma
|
110
|
+
- Officially support JRuby and Rubinius
|
101
111
|
|
102
112
|
### 0.4.7 / 2013-02-14
|
103
113
|
|
104
|
-
|
105
|
-
|
106
|
-
|
114
|
+
- Emit the `close` event if TCP is closed before CLOSE frame is acked
|
115
|
+
- Treat the `Upgrade: websocket` header case-insensitively because of IE10
|
116
|
+
- Do not suppress headers in the Thin and Rainbows adapters unless the status is
|
117
|
+
`101`
|
107
118
|
|
108
119
|
### 0.4.6 / 2012-07-09
|
109
120
|
|
110
|
-
|
121
|
+
- Add `Connection: close` to EventSource response
|
111
122
|
|
112
123
|
### 0.4.5 / 2012-04-06
|
113
124
|
|
114
|
-
|
115
|
-
|
125
|
+
- Add WebSocket error code `1011`.
|
126
|
+
- Handle URLs with no path correctly by sending `GET /`
|
116
127
|
|
117
128
|
### 0.4.4 / 2012-03-16
|
118
129
|
|
119
|
-
|
130
|
+
- Fix installation on JRuby with a platform-specific gem
|
120
131
|
|
121
132
|
### 0.4.3 / 2012-03-12
|
122
133
|
|
123
|
-
|
134
|
+
- Make `extconf.rb` a no-op on JRuby
|
124
135
|
|
125
136
|
### 0.4.2 / 2012-03-09
|
126
137
|
|
127
|
-
|
138
|
+
- Port masking-function C extension to Java for JRuby
|
128
139
|
|
129
140
|
### 0.4.1 / 2012-02-26
|
130
141
|
|
131
|
-
|
132
|
-
|
142
|
+
- Treat anything other than an `Array` as a string when calling `send()`
|
143
|
+
- Fix error loading UTF-8 validation code on Ruby 1.9 with `-Ku` flag
|
133
144
|
|
134
145
|
### 0.4.0 / 2012-02-13
|
135
146
|
|
136
|
-
|
137
|
-
|
147
|
+
- Add `ping()` method to server-side `WebSocket` and `EventSource`
|
148
|
+
- Buffer `send()` calls until the draft-76 handshake is complete
|
138
149
|
|
139
150
|
### 0.3.0 / 2012-01-13
|
140
151
|
|
141
|
-
|
142
|
-
|
152
|
+
- Add support for `EventSource` connections
|
153
|
+
- Support the Thin, Rainbows and Goliath web servers
|
143
154
|
|
144
155
|
### 0.2.0 / 2011-12-21
|
145
156
|
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
157
|
+
- Add support for `Sec-WebSocket-Protocol` negotiation
|
158
|
+
- Support `hixie-76` close frames and 75/76 ignored segments
|
159
|
+
- Improve performance of HyBi parsing/framing functions
|
160
|
+
- Write masking function in C
|
150
161
|
|
151
162
|
### 0.1.2 / 2011-12-05
|
152
163
|
|
153
|
-
|
164
|
+
- Make `hixie-76` sockets work through HAProxy
|
154
165
|
|
155
166
|
### 0.1.1 / 2011-11-30
|
156
167
|
|
157
|
-
|
168
|
+
- Fix `add_event_listener()` interface methods
|
158
169
|
|
159
170
|
### 0.1.0 / 2011-11-27
|
160
171
|
|
161
|
-
|
172
|
+
- Initial release, based on WebSocket components from Faye
|
data/README.md
CHANGED
@@ -1,9 +1,4 @@
|
|
1
|
-
# faye-websocket
|
2
|
-
|
3
|
-
* Travis CI build: [](http://travis-ci.org/faye/faye-websocket-ruby)
|
5
|
-
* Autobahn tests: [server](http://faye.jcoglan.com/autobahn/servers/),
|
6
|
-
[client](http://faye.jcoglan.com/autobahn/clients/)
|
1
|
+
# faye-websocket [](http://travis-ci.org/faye/faye-websocket-ruby)
|
7
2
|
|
8
3
|
This is a general-purpose WebSocket implementation extracted from the
|
9
4
|
[Faye](http://faye.jcoglan.com) project. It provides classes for easily building
|
@@ -22,11 +17,11 @@ access via proxies than WebSockets.
|
|
22
17
|
The following web servers are supported. Other servers that implement the
|
23
18
|
`rack.hijack` API should also work.
|
24
19
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
20
|
+
- [Goliath](http://postrank-labs.github.com/goliath/)
|
21
|
+
- [Phusion Passenger](https://www.phusionpassenger.com/) >= 4.0 with nginx >= 1.4
|
22
|
+
- [Puma](http://puma.io/) >= 2.0
|
23
|
+
- [Rainbows](http://rainbows.bogomips.org/)
|
24
|
+
- [Thin](http://code.macournoyer.com/thin/)
|
30
25
|
|
31
26
|
|
32
27
|
## Installation
|
@@ -190,16 +185,16 @@ ws = Faye::WebSocket::Client.new(url, protocols, options)
|
|
190
185
|
`protocols` as an array of subprotocols as described above, or `nil`. `options`
|
191
186
|
is an optional hash containing any of these keys:
|
192
187
|
|
193
|
-
|
188
|
+
- `:extensions` - an array of
|
194
189
|
[websocket-extensions](https://github.com/faye/websocket-extensions-ruby)
|
195
190
|
compatible extensions, as described above
|
196
|
-
|
191
|
+
- `:headers` - a hash containing key-value pairs representing HTTP headers to be
|
197
192
|
sent during the handshake process
|
198
|
-
|
193
|
+
- `:max_length` - the maximum allowed size of incoming message frames, in bytes.
|
199
194
|
The default value is `2^26 - 1`, or 1 byte short of 64 MiB.
|
200
|
-
|
195
|
+
- `:ping` - an integer that sets how often the WebSocket should send ping
|
201
196
|
frames, measured in seconds
|
202
|
-
|
197
|
+
- `:tls` - a hash containing key-value pairs for specifying TLS parameters.
|
203
198
|
These are passed along to EventMachine and you can find
|
204
199
|
[more details here](http://rubydoc.info/gems/eventmachine/EventMachine%2FConnection%3Astart_tls)
|
205
200
|
|
@@ -207,28 +202,28 @@ is an optional hash containing any of these keys:
|
|
207
202
|
|
208
203
|
Both the server- and client-side `WebSocket` objects support the following API:
|
209
204
|
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
205
|
+
- **`on(:open) { |event| }`** fires when the socket connection is established.
|
206
|
+
Event has no attributes.
|
207
|
+
- **`on(:message) { |event| }`** fires when the socket receives a message. Event
|
208
|
+
has one attribute, **`data`**, which is either a `String` (for text frames) or
|
209
|
+
an `Array` of byte-sized integers (for binary frames).
|
210
|
+
- **`on(:error) { |event| }`** fires when there is a protocol error due to bad
|
211
|
+
data sent by the other peer. This event is purely informational, you do not
|
212
|
+
need to implement error recovery.
|
213
|
+
- **`on(:close) { |event| }`** fires when either the client or the server closes
|
214
|
+
the connection. Event has two optional attributes, **`code`** and
|
215
|
+
**`reason`**, that expose the status code and message sent by the peer that
|
221
216
|
closed the connection.
|
222
|
-
|
217
|
+
- **`send(message)`** accepts either a `String` or an `Array` of byte-sized
|
223
218
|
integers and sends a text or binary message over the connection to the other
|
224
219
|
peer; binary data must be encoded as an `Array`.
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
220
|
+
- **`ping(message, &callback)`** sends a ping frame with an optional message and
|
221
|
+
fires the callback when a matching pong is received.
|
222
|
+
- **`close(code, reason)`** closes the connection, sending the given status code
|
223
|
+
and reason text, both of which are optional.
|
224
|
+
- **`version`** is a string containing the version of the `WebSocket` protocol
|
225
|
+
the connection is using.
|
226
|
+
- **`protocol`** is a string (which may be empty) identifying the subprotocol
|
232
227
|
the socket is using.
|
233
228
|
|
234
229
|
|
@@ -276,22 +271,22 @@ es.send('Breaking News!', :event => 'notification', :id => '99')
|
|
276
271
|
|
277
272
|
The `EventSource` object exposes the following properties:
|
278
273
|
|
279
|
-
|
274
|
+
- **`url`** is a string containing the URL the client used to create the
|
280
275
|
EventSource.
|
281
|
-
|
282
|
-
|
283
|
-
|
276
|
+
- **`last_event_id`** is a string containing the last event ID received by the
|
277
|
+
client. You can use this when the client reconnects after a dropped connection
|
278
|
+
to determine which messages need resending.
|
284
279
|
|
285
280
|
When you initialize an EventSource with `Faye::EventSource.new`, you can pass
|
286
281
|
configuration options after the `env` parameter. Available options are:
|
287
282
|
|
288
|
-
|
283
|
+
- **`:headers`** is a hash containing custom headers to be set on the
|
289
284
|
EventSource response.
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
285
|
+
- **`:retry`** is a number that tells the client how long (in seconds) it should
|
286
|
+
wait after a dropped connection before attempting to reconnect.
|
287
|
+
- **`:ping`** is a number that tells the server how often (in seconds) to send
|
288
|
+
'ping' packets to the client to keep the connection open, to defeat timeouts
|
289
|
+
set by proxies. The client will ignore these messages.
|
295
290
|
|
296
291
|
For example, this creates a connection that allows access from any origin, pings
|
297
292
|
every 15 seconds and is retryable every 10 seconds if the connection is broken:
|
@@ -487,27 +482,3 @@ class EchoServer < Goliath::API
|
|
487
482
|
end
|
488
483
|
end
|
489
484
|
```
|
490
|
-
|
491
|
-
|
492
|
-
## License
|
493
|
-
|
494
|
-
(The MIT License)
|
495
|
-
|
496
|
-
Copyright (c) 2010-2017 James Coglan
|
497
|
-
|
498
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
499
|
-
this software and associated documentation files (the 'Software'), to deal in
|
500
|
-
the Software without restriction, including without limitation the rights to
|
501
|
-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
502
|
-
the Software, and to permit persons to whom the Software is furnished to do so,
|
503
|
-
subject to the following conditions:
|
504
|
-
|
505
|
-
The above copyright notice and this permission notice shall be included in all
|
506
|
-
copies or substantial portions of the Software.
|
507
|
-
|
508
|
-
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
509
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
510
|
-
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
511
|
-
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
512
|
-
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
513
|
-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/examples/autobahn_client.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'rubygems'
|
2
1
|
require 'bundler/setup'
|
3
2
|
require 'cgi'
|
4
3
|
require 'faye/websocket'
|
@@ -6,9 +5,12 @@ require 'permessage_deflate'
|
|
6
5
|
require 'progressbar'
|
7
6
|
|
8
7
|
EM.run {
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
ruby = RUBY_PLATFORM =~ /java/ ? 'jruby' : 'mri-ruby'
|
9
|
+
version = defined?(RUBY_ENGINE_VERSION) ? RUBY_ENGINE_VERSION : RUBY_VERSION
|
10
|
+
version += " (#{RUBY_VERSION})" if ruby == 'jruby'
|
11
|
+
|
12
|
+
host = 'ws://0.0.0.0:9001'
|
13
|
+
agent = CGI.escape("#{ruby}-#{version}")
|
12
14
|
cases = 0
|
13
15
|
options = {:extensions => [PermessageDeflate]}
|
14
16
|
|
data/examples/client.rb
CHANGED
data/examples/config.ru
CHANGED
data/examples/proxy_server.rb
CHANGED
data/examples/server.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'rubygems'
|
2
1
|
require 'bundler/setup'
|
3
2
|
require 'rack/content_length'
|
4
3
|
require 'rack/chunked'
|
@@ -40,7 +39,7 @@ when 'rainbows'
|
|
40
39
|
|
41
40
|
when 'thin'
|
42
41
|
thin = Rack::Handler.get('thin')
|
43
|
-
thin.run(App, :Port => port) do |server|
|
42
|
+
thin.run(App, :Host => '0.0.0.0', :Port => port) do |server|
|
44
43
|
if secure
|
45
44
|
server.ssl_options = {
|
46
45
|
:private_key_file => spec + '/server.key',
|
data/lib/faye/websocket/api.rb
CHANGED
@@ -43,7 +43,7 @@ module Faye
|
|
43
43
|
|
44
44
|
@driver.on(:open) { |e| open }
|
45
45
|
@driver.on(:message) { |e| receive_message(e.data) }
|
46
|
-
@driver.on(:close) { |e| begin_close(e.reason, e.code) }
|
46
|
+
@driver.on(:close) { |e| begin_close(e.reason, e.code, :wait_for_write => true) }
|
47
47
|
|
48
48
|
@driver.on(:error) do |error|
|
49
49
|
emit_error(error.message)
|
@@ -87,9 +87,9 @@ module Faye
|
|
87
87
|
end
|
88
88
|
|
89
89
|
@ready_state = CLOSING unless @ready_state == CLOSED
|
90
|
-
@driver.close(reason, code)
|
91
|
-
|
92
90
|
@close_timer = EventMachine.add_timer(CLOSE_TIMEOUT) { begin_close('', 1006) }
|
91
|
+
|
92
|
+
@driver.close(reason, code)
|
93
93
|
end
|
94
94
|
|
95
95
|
def protocol
|
@@ -121,13 +121,17 @@ module Faye
|
|
121
121
|
dispatch_event(event)
|
122
122
|
end
|
123
123
|
|
124
|
-
def begin_close(reason, code)
|
124
|
+
def begin_close(reason, code, options = {})
|
125
125
|
return if @ready_state == CLOSED
|
126
126
|
@ready_state = CLOSING
|
127
127
|
@close_params = [reason, code]
|
128
128
|
|
129
129
|
if @stream
|
130
|
-
|
130
|
+
if options[:wait_for_write]
|
131
|
+
@stream.close_connection_after_writing
|
132
|
+
else
|
133
|
+
@stream.close_connection
|
134
|
+
end
|
131
135
|
else
|
132
136
|
finalize_close
|
133
137
|
end
|
@@ -23,29 +23,7 @@ module Faye
|
|
23
23
|
@origin_tls = options.fetch(:tls, {})
|
24
24
|
@socket_tls = proxy[:origin] ? proxy.fetch(:tls, {}) : @origin_tls
|
25
25
|
|
26
|
-
|
27
|
-
@proxy = @driver.proxy(proxy[:origin])
|
28
|
-
if headers = proxy[:headers]
|
29
|
-
headers.each { |name, value| @proxy.set_header(name, value) }
|
30
|
-
end
|
31
|
-
|
32
|
-
@proxy.on(:connect) do
|
33
|
-
uri = URI.parse(@url)
|
34
|
-
secure = SECURE_PROTOCOLS.include?(uri.scheme)
|
35
|
-
@proxy = nil
|
36
|
-
|
37
|
-
if secure
|
38
|
-
origin_tls = {:sni_hostname => uri.host}.merge(@origin_tls)
|
39
|
-
@stream.start_tls(origin_tls)
|
40
|
-
end
|
41
|
-
|
42
|
-
@driver.start
|
43
|
-
end
|
44
|
-
|
45
|
-
@proxy.on(:error) do |error|
|
46
|
-
@driver.emit(:error, error)
|
47
|
-
end
|
48
|
-
end
|
26
|
+
configure_proxy(proxy)
|
49
27
|
|
50
28
|
EventMachine.connect(endpoint.host, port, Connection) do |conn|
|
51
29
|
conn.parent = self
|
@@ -57,6 +35,30 @@ module Faye
|
|
57
35
|
|
58
36
|
private
|
59
37
|
|
38
|
+
def configure_proxy(proxy)
|
39
|
+
return unless proxy[:origin]
|
40
|
+
|
41
|
+
@proxy = @driver.proxy(proxy[:origin])
|
42
|
+
@proxy.on(:error) { |error| @driver.emit(:error, error) }
|
43
|
+
|
44
|
+
if headers = proxy[:headers]
|
45
|
+
headers.each { |name, value| @proxy.set_header(name, value) }
|
46
|
+
end
|
47
|
+
|
48
|
+
@proxy.on(:connect) do
|
49
|
+
uri = URI.parse(@url)
|
50
|
+
secure = SECURE_PROTOCOLS.include?(uri.scheme)
|
51
|
+
@proxy = nil
|
52
|
+
|
53
|
+
if secure
|
54
|
+
origin_tls = {:sni_hostname => uri.host}.merge(@origin_tls)
|
55
|
+
@stream.start_tls(origin_tls)
|
56
|
+
end
|
57
|
+
|
58
|
+
@driver.start
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
60
62
|
def on_connect(stream)
|
61
63
|
@stream = stream
|
62
64
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: faye-websocket
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Coglan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: eventmachine
|
@@ -66,20 +66,6 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: public_suffix
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - "<"
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: 1.5.0
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - "<"
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: 1.5.0
|
83
69
|
- !ruby/object:Gem::Dependency
|
84
70
|
name: puma
|
85
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -168,14 +154,14 @@ dependencies:
|
|
168
154
|
name: goliath
|
169
155
|
requirement: !ruby/object:Gem::Requirement
|
170
156
|
requirements:
|
171
|
-
- - "
|
157
|
+
- - ">"
|
172
158
|
- !ruby/object:Gem::Version
|
173
159
|
version: '0'
|
174
160
|
type: :development
|
175
161
|
prerelease: false
|
176
162
|
version_requirements: !ruby/object:Gem::Requirement
|
177
163
|
requirements:
|
178
|
-
- - "
|
164
|
+
- - ">"
|
179
165
|
- !ruby/object:Gem::Version
|
180
166
|
version: '0'
|
181
167
|
- !ruby/object:Gem::Dependency
|
@@ -225,7 +211,7 @@ files:
|
|
225
211
|
- lib/faye/websocket/client.rb
|
226
212
|
homepage: https://github.com/faye/faye-websocket-ruby
|
227
213
|
licenses:
|
228
|
-
-
|
214
|
+
- Apache-2.0
|
229
215
|
metadata: {}
|
230
216
|
post_install_message:
|
231
217
|
rdoc_options:
|
@@ -246,8 +232,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
246
232
|
- !ruby/object:Gem::Version
|
247
233
|
version: '0'
|
248
234
|
requirements: []
|
249
|
-
|
250
|
-
rubygems_version: 2.6.8
|
235
|
+
rubygems_version: 3.0.3
|
251
236
|
signing_key:
|
252
237
|
specification_version: 4
|
253
238
|
summary: Standards-compliant WebSocket server and client
|