reel 0.6.0.pre1 → 0.6.0.pre2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of reel might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/lib/reel/request/state_machine.rb +4 -2
- data/lib/reel/version.rb +1 -1
- data/lib/reel/websocket.rb +15 -15
- data/reel.gemspec +0 -1
- metadata +19 -33
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37c2a121aacbd4e703ab370edb1f7e5a2b6207b5
|
4
|
+
data.tar.gz: 2cadca939df61f1ec640d9043291580f67f49fe3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22d122ff37bc6e4b755465306d40c09d272c420c67aa4b4979efe1169bffffb6e077c8a7b4b9d48703ad118ea7022abc52a095ff7ce61d2efa44504178bcaf42
|
7
|
+
data.tar.gz: ac2e9e5ebf765d08ee9ab6caa2e43236d77cd818d0234bf513ce6848422a0909e9416792d9513ef96bed778e196150618ce6913130b9513dd7e864f5915899db
|
@@ -18,9 +18,11 @@ module Reel
|
|
18
18
|
@hijacked = true
|
19
19
|
end
|
20
20
|
|
21
|
-
|
21
|
+
# FSM fails open for valid transitions
|
22
|
+
# Set an empty array to disallow transitioning out of closed
|
23
|
+
state :closed, :to => [] do
|
22
24
|
@socket.close unless @hijacked || @socket.closed?
|
23
25
|
end
|
24
26
|
end
|
25
27
|
end
|
26
|
-
end
|
28
|
+
end
|
data/lib/reel/version.rb
CHANGED
data/lib/reel/websocket.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
require 'forwardable'
|
2
2
|
require 'websocket/driver'
|
3
|
-
require 'rack'
|
4
3
|
|
5
4
|
module Reel
|
6
5
|
class WebSocket
|
@@ -10,10 +9,11 @@ module Reel
|
|
10
9
|
|
11
10
|
attr_reader :socket
|
12
11
|
def_delegators :@socket, :addr, :peeraddr
|
12
|
+
def_delegators :@driver, :ping
|
13
13
|
|
14
14
|
def initialize(info, connection)
|
15
|
-
driver_env = DriverEnvironment.new(info, connection.socket)
|
16
|
-
|
15
|
+
driver_env = DriverEnvironment.new(info, connection.socket)
|
16
|
+
|
17
17
|
@socket = connection.hijack_socket
|
18
18
|
@request_info = info
|
19
19
|
|
@@ -98,19 +98,19 @@ module Reel
|
|
98
98
|
|
99
99
|
def_delegators :socket, :write
|
100
100
|
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
})
|
111
|
-
|
112
|
-
@env = ::Rack::MockRequest.env_for(@url, env_hash)
|
101
|
+
RACK_HEADERS = {
|
102
|
+
'Origin' => 'HTTP_ORIGIN',
|
103
|
+
'Sec-WebSocket-Key' => 'HTTP_SEC_WEBSOCKET_KEY',
|
104
|
+
'Sec-WebSocket-Key1' => 'HTTP_SEC_WEBSOCKET_KEY1',
|
105
|
+
'Sec-WebSocket-Key2' => 'HTTP_SEC_WEBSOCKET_KEY2',
|
106
|
+
'Sec-WebSocket-Extensions' => 'HTTP_SEC_WEBSOCKET_EXTENSIONS',
|
107
|
+
'Sec-WebSocket-Protocol' => 'HTTP_SEC_WEBSOCKET_PROTOCOL',
|
108
|
+
'Sec-WebSocket-Version' => 'HTTP_SEC_WEBSOCKET_VERSION'
|
109
|
+
}
|
113
110
|
|
111
|
+
def initialize(info, socket)
|
112
|
+
@env, @url = {}, info.url
|
113
|
+
RACK_HEADERS.each {|k,v| @env[v] = info.headers[k]}
|
114
114
|
@socket = socket
|
115
115
|
end
|
116
116
|
end
|
data/reel.gemspec
CHANGED
@@ -20,7 +20,6 @@ Gem::Specification.new do |gem|
|
|
20
20
|
gem.add_runtime_dependency 'http', '>= 0.6.0.pre'
|
21
21
|
gem.add_runtime_dependency 'http_parser.rb', '>= 0.6.0'
|
22
22
|
gem.add_runtime_dependency 'websocket-driver', '>= 0.5.1'
|
23
|
-
gem.add_runtime_dependency 'rack'
|
24
23
|
|
25
24
|
gem.add_development_dependency 'rake'
|
26
25
|
gem.add_development_dependency 'rspec', '>= 2.11.0'
|
metadata
CHANGED
@@ -1,150 +1,136 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: reel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.0.
|
4
|
+
version: 0.6.0.pre2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tony Arcieri
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-04-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
type: :runtime
|
15
14
|
name: celluloid
|
16
|
-
prerelease: false
|
17
15
|
requirement: !ruby/object:Gem::Requirement
|
18
16
|
requirements:
|
19
17
|
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: 0.15.1
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 0.15.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
type: :runtime
|
29
28
|
name: celluloid-io
|
30
|
-
prerelease: false
|
31
29
|
requirement: !ruby/object:Gem::Requirement
|
32
30
|
requirements:
|
33
31
|
- - ">="
|
34
32
|
- !ruby/object:Gem::Version
|
35
33
|
version: 0.15.0
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 0.15.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
type: :runtime
|
43
42
|
name: http
|
44
|
-
prerelease: false
|
45
43
|
requirement: !ruby/object:Gem::Requirement
|
46
44
|
requirements:
|
47
45
|
- - ">="
|
48
46
|
- !ruby/object:Gem::Version
|
49
47
|
version: 0.6.0.pre
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 0.6.0.pre
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
type: :runtime
|
57
56
|
name: http_parser.rb
|
58
|
-
prerelease: false
|
59
57
|
requirement: !ruby/object:Gem::Requirement
|
60
58
|
requirements:
|
61
59
|
- - ">="
|
62
60
|
- !ruby/object:Gem::Version
|
63
61
|
version: 0.6.0
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 0.6.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
type: :runtime
|
71
70
|
name: websocket-driver
|
72
|
-
prerelease: false
|
73
71
|
requirement: !ruby/object:Gem::Requirement
|
74
72
|
requirements:
|
75
73
|
- - ">="
|
76
74
|
- !ruby/object:Gem::Version
|
77
75
|
version: 0.5.1
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: 0.5.1
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
76
|
type: :runtime
|
85
|
-
name: rack
|
86
77
|
prerelease: false
|
87
|
-
requirement: !ruby/object:Gem::Requirement
|
88
|
-
requirements:
|
89
|
-
- - ">="
|
90
|
-
- !ruby/object:Gem::Version
|
91
|
-
version: '0'
|
92
78
|
version_requirements: !ruby/object:Gem::Requirement
|
93
79
|
requirements:
|
94
80
|
- - ">="
|
95
81
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
82
|
+
version: 0.5.1
|
97
83
|
- !ruby/object:Gem::Dependency
|
98
|
-
type: :development
|
99
84
|
name: rake
|
100
|
-
prerelease: false
|
101
85
|
requirement: !ruby/object:Gem::Requirement
|
102
86
|
requirements:
|
103
87
|
- - ">="
|
104
88
|
- !ruby/object:Gem::Version
|
105
89
|
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
106
92
|
version_requirements: !ruby/object:Gem::Requirement
|
107
93
|
requirements:
|
108
94
|
- - ">="
|
109
95
|
- !ruby/object:Gem::Version
|
110
96
|
version: '0'
|
111
97
|
- !ruby/object:Gem::Dependency
|
112
|
-
type: :development
|
113
98
|
name: rspec
|
114
|
-
prerelease: false
|
115
99
|
requirement: !ruby/object:Gem::Requirement
|
116
100
|
requirements:
|
117
101
|
- - ">="
|
118
102
|
- !ruby/object:Gem::Version
|
119
103
|
version: 2.11.0
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
120
106
|
version_requirements: !ruby/object:Gem::Requirement
|
121
107
|
requirements:
|
122
108
|
- - ">="
|
123
109
|
- !ruby/object:Gem::Version
|
124
110
|
version: 2.11.0
|
125
111
|
- !ruby/object:Gem::Dependency
|
126
|
-
type: :development
|
127
112
|
name: certificate_authority
|
128
|
-
prerelease: false
|
129
113
|
requirement: !ruby/object:Gem::Requirement
|
130
114
|
requirements:
|
131
115
|
- - ">="
|
132
116
|
- !ruby/object:Gem::Version
|
133
117
|
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
134
120
|
version_requirements: !ruby/object:Gem::Requirement
|
135
121
|
requirements:
|
136
122
|
- - ">="
|
137
123
|
- !ruby/object:Gem::Version
|
138
124
|
version: '0'
|
139
125
|
- !ruby/object:Gem::Dependency
|
140
|
-
type: :development
|
141
126
|
name: websocket_parser
|
142
|
-
prerelease: false
|
143
127
|
requirement: !ruby/object:Gem::Requirement
|
144
128
|
requirements:
|
145
129
|
- - ">="
|
146
130
|
- !ruby/object:Gem::Version
|
147
131
|
version: 0.1.6
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
148
134
|
version_requirements: !ruby/object:Gem::Requirement
|
149
135
|
requirements:
|
150
136
|
- - ">="
|