websocket-driver 0.6.4 → 0.6.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/LICENSE.md +22 -0
- data/README.md +0 -24
- data/lib/websocket/driver.rb +9 -1
- data/lib/websocket/mask.rb +14 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 45f6962eb4b7b927eddff1e14c1368464227ef7f
|
4
|
+
data.tar.gz: 8e98a4638c104fce2ccc752f87eadd1269f8a643
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fcc93ef62b0bd24fb9f1687874591ff7747c0a02896d395195ff699381b9c3d4d1888c4fbe079e017442f8e79a8c908c514fdf4550f872303fef6351c7484bb2
|
7
|
+
data.tar.gz: 1f9215cc0926f4d7d6d083939dc2a8c83a6ca89e1eb30af2ae064ec16239936a12f69cd4a2dda12651358a2402a90fd59533b00b8d18e413d580269a418a2bc3
|
data/CHANGELOG.md
CHANGED
data/LICENSE.md
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# License
|
2
|
+
|
3
|
+
(The MIT License)
|
4
|
+
|
5
|
+
Copyright (c) 2010-2017 James Coglan
|
6
|
+
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
8
|
+
this software and associated documentation files (the 'Software'), to deal in
|
9
|
+
the Software without restriction, including without limitation the rights to
|
10
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
11
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
12
|
+
subject to the following conditions:
|
13
|
+
|
14
|
+
The above copyright notice and this permission notice shall be included in all
|
15
|
+
copies or substantial portions of the Software.
|
16
|
+
|
17
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
19
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
20
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
21
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
22
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
@@ -367,27 +367,3 @@ Returns the WebSocket version in use as a string. Will either be `hixie-75`,
|
|
367
367
|
Returns a string containing the selected subprotocol, if any was agreed upon
|
368
368
|
using the `Sec-WebSocket-Protocol` mechanism. This value becomes available after
|
369
369
|
`emit('open')` has fired.
|
370
|
-
|
371
|
-
|
372
|
-
## License
|
373
|
-
|
374
|
-
(The MIT License)
|
375
|
-
|
376
|
-
Copyright (c) 2010-2016 James Coglan
|
377
|
-
|
378
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
379
|
-
this software and associated documentation files (the 'Software'), to deal in
|
380
|
-
the Software without restriction, including without limitation the rights to
|
381
|
-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
382
|
-
the Software, and to permit persons to whom the Software is furnished to do so,
|
383
|
-
subject to the following conditions:
|
384
|
-
|
385
|
-
The above copyright notice and this permission notice shall be included in all
|
386
|
-
copies or substantial portions of the Software.
|
387
|
-
|
388
|
-
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
389
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
390
|
-
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
391
|
-
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
392
|
-
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
393
|
-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/lib/websocket/driver.rb
CHANGED
@@ -19,7 +19,15 @@ module WebSocket
|
|
19
19
|
class Driver
|
20
20
|
|
21
21
|
root = File.expand_path('../driver', __FILE__)
|
22
|
-
|
22
|
+
|
23
|
+
begin
|
24
|
+
# Load C native extension
|
25
|
+
require 'websocket_mask'
|
26
|
+
rescue LoadError
|
27
|
+
# Fall back to pure-Ruby implementation
|
28
|
+
require 'websocket/mask'
|
29
|
+
end
|
30
|
+
|
23
31
|
|
24
32
|
if RUBY_PLATFORM =~ /java/
|
25
33
|
require 'jruby'
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module WebSocket
|
2
|
+
module Mask
|
3
|
+
def self.mask(payload, mask)
|
4
|
+
return payload if mask.nil? || payload.empty?
|
5
|
+
|
6
|
+
payload.tap do |result|
|
7
|
+
payload.bytesize.times do |i|
|
8
|
+
result.setbyte(i, payload.getbyte(i) ^ mask.getbyte(i % 4))
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: websocket-driver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.5
|
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: 2017-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: websocket-extensions
|
@@ -89,6 +89,7 @@ extra_rdoc_files:
|
|
89
89
|
- README.md
|
90
90
|
files:
|
91
91
|
- CHANGELOG.md
|
92
|
+
- LICENSE.md
|
92
93
|
- README.md
|
93
94
|
- examples/tcp_server.rb
|
94
95
|
- ext/websocket-driver/WebsocketMaskService.java
|
@@ -110,6 +111,7 @@ files:
|
|
110
111
|
- lib/websocket/http/headers.rb
|
111
112
|
- lib/websocket/http/request.rb
|
112
113
|
- lib/websocket/http/response.rb
|
114
|
+
- lib/websocket/mask.rb
|
113
115
|
- lib/websocket/websocket_mask.rb
|
114
116
|
homepage: http://github.com/faye/websocket-driver-ruby
|
115
117
|
licenses:
|
@@ -135,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
135
137
|
version: '0'
|
136
138
|
requirements: []
|
137
139
|
rubyforge_project:
|
138
|
-
rubygems_version: 2.
|
140
|
+
rubygems_version: 2.6.8
|
139
141
|
signing_key:
|
140
142
|
specification_version: 4
|
141
143
|
summary: WebSocket protocol handler with pluggable I/O
|