faye-websocket 0.5.0 → 0.6.0
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.
- data/CHANGELOG.md +5 -0
- data/README.md +53 -1
- data/examples/client.rb +10 -9
- data/examples/log/passenger.8001.log +1246 -0
- data/examples/tmp/pids/passenger.7000.pid +1 -0
- data/examples/tmp/pids/passenger.7000.pid.lock +0 -0
- data/examples/tmp/pids/passenger.8001.pid.lock +0 -0
- data/lib/faye/websocket.rb +1 -3
- data/lib/faye/websocket/api.rb +9 -3
- data/lib/faye/websocket/client.rb +11 -3
- metadata +24 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
13712
|
|
File without changes
|
|
File without changes
|
data/lib/faye/websocket.rb
CHANGED
|
@@ -59,14 +59,12 @@ module Faye
|
|
|
59
59
|
@url = WebSocket.determine_url(@env)
|
|
60
60
|
@driver = ::WebSocket::Driver.rack(self, :protocols => protocols)
|
|
61
61
|
@stream = Stream.new(self)
|
|
62
|
-
@ping = options[:ping]
|
|
63
|
-
@ping_id = 0
|
|
64
62
|
|
|
65
63
|
if callback = @env['async.callback']
|
|
66
64
|
callback.call([101, {}, @stream])
|
|
67
65
|
end
|
|
68
66
|
|
|
69
|
-
super()
|
|
67
|
+
super(options)
|
|
70
68
|
@driver.start
|
|
71
69
|
end
|
|
72
70
|
|
data/lib/faye/websocket/api.rb
CHANGED
|
@@ -17,10 +17,16 @@ module Faye
|
|
|
17
17
|
|
|
18
18
|
attr_reader :url, :ready_state, :buffered_amount
|
|
19
19
|
|
|
20
|
-
def initialize
|
|
21
|
-
super
|
|
20
|
+
def initialize(options = {})
|
|
21
|
+
super()
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
if headers = options[:headers]
|
|
24
|
+
headers.each { |name, value| @driver.set_header(name, value) }
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
@ping = options[:ping]
|
|
28
|
+
@ping_id = 0
|
|
29
|
+
@ready_state = CONNECTING
|
|
24
30
|
@buffered_amount = 0
|
|
25
31
|
|
|
26
32
|
@driver.on(:open) { |e| open }
|
|
@@ -4,15 +4,23 @@ module Faye
|
|
|
4
4
|
class Client
|
|
5
5
|
include API
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
attr_reader :headers, :status
|
|
8
|
+
|
|
9
|
+
def initialize(url, protocols = nil, options = {})
|
|
8
10
|
@url = url
|
|
9
11
|
@uri = URI.parse(url)
|
|
10
12
|
@driver = ::WebSocket::Driver.client(self, :protocols => protocols)
|
|
11
13
|
|
|
12
|
-
|
|
14
|
+
[:open, :error].each do |event|
|
|
15
|
+
@driver.on(event) do
|
|
16
|
+
@headers = @driver.headers
|
|
17
|
+
@status = @driver.status
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
super(options)
|
|
13
22
|
|
|
14
23
|
port = @uri.port || (@uri.scheme == 'wss' ? 443 : 80)
|
|
15
|
-
|
|
16
24
|
EventMachine.connect(@uri.host, port, Connection) do |conn|
|
|
17
25
|
@stream = conn
|
|
18
26
|
conn.parent = self
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: faye-websocket
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.6.0
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2013-05-
|
|
12
|
+
date: 2013-05-12 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: eventmachine
|
|
@@ -34,7 +34,7 @@ dependencies:
|
|
|
34
34
|
requirements:
|
|
35
35
|
- - ! '>='
|
|
36
36
|
- !ruby/object:Gem::Version
|
|
37
|
-
version:
|
|
37
|
+
version: 0.2.0
|
|
38
38
|
type: :runtime
|
|
39
39
|
prerelease: false
|
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -42,7 +42,7 @@ dependencies:
|
|
|
42
42
|
requirements:
|
|
43
43
|
- - ! '>='
|
|
44
44
|
- !ruby/object:Gem::Version
|
|
45
|
-
version:
|
|
45
|
+
version: 0.2.0
|
|
46
46
|
- !ruby/object:Gem::Dependency
|
|
47
47
|
name: progressbar
|
|
48
48
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -155,6 +155,22 @@ dependencies:
|
|
|
155
155
|
- - ! '>='
|
|
156
156
|
- !ruby/object:Gem::Version
|
|
157
157
|
version: '0'
|
|
158
|
+
- !ruby/object:Gem::Dependency
|
|
159
|
+
name: passenger
|
|
160
|
+
requirement: !ruby/object:Gem::Requirement
|
|
161
|
+
none: false
|
|
162
|
+
requirements:
|
|
163
|
+
- - ! '>='
|
|
164
|
+
- !ruby/object:Gem::Version
|
|
165
|
+
version: 4.0.0
|
|
166
|
+
type: :development
|
|
167
|
+
prerelease: false
|
|
168
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
169
|
+
none: false
|
|
170
|
+
requirements:
|
|
171
|
+
- - ! '>='
|
|
172
|
+
- !ruby/object:Gem::Version
|
|
173
|
+
version: 4.0.0
|
|
158
174
|
description:
|
|
159
175
|
email: jcoglan@gmail.com
|
|
160
176
|
executables: []
|
|
@@ -180,9 +196,13 @@ files:
|
|
|
180
196
|
- examples/config.ru
|
|
181
197
|
- examples/rainbows.conf
|
|
182
198
|
- examples/sse.html
|
|
199
|
+
- examples/log/passenger.8001.log
|
|
183
200
|
- examples/app.rb
|
|
184
201
|
- examples/server.rb
|
|
185
202
|
- examples/client.rb
|
|
203
|
+
- examples/tmp/pids/passenger.7000.pid
|
|
204
|
+
- examples/tmp/pids/passenger.7000.pid.lock
|
|
205
|
+
- examples/tmp/pids/passenger.8001.pid.lock
|
|
186
206
|
- examples/haproxy.conf
|
|
187
207
|
- examples/autobahn_client.rb
|
|
188
208
|
homepage: http://github.com/faye/faye-websocket-ruby
|