protocol-websocket 0.7.4 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +3 -0
- data/lib/.DS_Store +0 -0
- data/lib/protocol/.DS_Store +0 -0
- data/lib/protocol/websocket/binary_frame.rb +5 -0
- data/lib/protocol/websocket/close_frame.rb +32 -2
- data/lib/protocol/websocket/connection.rb +90 -57
- data/lib/protocol/websocket/extension/compression/constants.rb +34 -0
- data/lib/protocol/websocket/extension/compression/deflate.rb +105 -0
- data/lib/protocol/websocket/extension/compression/inflate.rb +91 -0
- data/lib/protocol/websocket/extension/compression.rb +137 -0
- data/lib/protocol/websocket/extensions.md +13 -0
- data/lib/protocol/websocket/extensions.rb +148 -0
- data/lib/protocol/websocket/frame.rb +43 -15
- data/lib/protocol/websocket/framer.rb +7 -3
- data/lib/protocol/websocket/headers.rb +5 -1
- data/lib/protocol/websocket/message.rb +61 -0
- data/lib/protocol/websocket/ping_frame.rb +5 -2
- data/lib/protocol/websocket/pong_frame.rb +1 -0
- data/lib/protocol/websocket/text_frame.rb +13 -6
- data/lib/protocol/websocket/version.rb +1 -1
- data/lib/protocol/websocket.rb +1 -0
- data.tar.gz.sig +0 -0
- metadata +56 -36
- metadata.gz.sig +0 -0
- data/.gitignore +0 -13
- data/.rspec +0 -3
- data/.travis.yml +0 -19
- data/Gemfile +0 -4
- data/README.md +0 -64
- data/Rakefile +0 -6
- data/protocol-websocket.gemspec +0 -28
data/.travis.yml
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
dist: xenial
|
3
|
-
cache: bundler
|
4
|
-
|
5
|
-
matrix:
|
6
|
-
include:
|
7
|
-
- rvm: 2.4
|
8
|
-
- rvm: 2.5
|
9
|
-
- rvm: 2.6
|
10
|
-
- rvm: 2.6
|
11
|
-
env: COVERAGE=PartialSummary,Coveralls
|
12
|
-
- rvm: truffleruby
|
13
|
-
- rvm: jruby-head
|
14
|
-
env: JRUBY_OPTS="--debug -X+O"
|
15
|
-
- rvm: ruby-head
|
16
|
-
allow_failures:
|
17
|
-
- rvm: truffleruby
|
18
|
-
- rvm: ruby-head
|
19
|
-
- rvm: jruby-head
|
data/Gemfile
DELETED
data/README.md
DELETED
@@ -1,64 +0,0 @@
|
|
1
|
-
# Protocol::WebSocket
|
2
|
-
|
3
|
-
Provides a low-level implementation of the WebSocket protocol according to [RFC6455](https://tools.ietf.org/html/rfc6455). It only implements the latest stable version (13).
|
4
|
-
|
5
|
-
[![Build Status](https://travis-ci.com/socketry/protocol-websocket.svg?branch=master)](http://travis-ci.com/socketry/protocol-websocket)
|
6
|
-
|
7
|
-
## Installation
|
8
|
-
|
9
|
-
Add this line to your application's Gemfile:
|
10
|
-
|
11
|
-
```ruby
|
12
|
-
gem 'protocol-websocket'
|
13
|
-
```
|
14
|
-
|
15
|
-
And then execute:
|
16
|
-
|
17
|
-
$ bundle
|
18
|
-
|
19
|
-
Or install it yourself as:
|
20
|
-
|
21
|
-
$ gem install protocol-websocket
|
22
|
-
|
23
|
-
## Usage
|
24
|
-
|
25
|
-
Here is a basic WebSocket client:
|
26
|
-
|
27
|
-
```ruby
|
28
|
-
stream = # connect to remote system
|
29
|
-
framer = Protocol::WebSocket::Framer.new(stream)
|
30
|
-
|
31
|
-
frame = framer.read_frame
|
32
|
-
```
|
33
|
-
|
34
|
-
## Contributing
|
35
|
-
|
36
|
-
1. Fork it
|
37
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
38
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
39
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
40
|
-
5. Create new Pull Request
|
41
|
-
|
42
|
-
## License
|
43
|
-
|
44
|
-
Released under the MIT license.
|
45
|
-
|
46
|
-
Copyright, 2019, by [Samuel G. D. Williams](http://www.codeotaku.com/samuel-williams).
|
47
|
-
|
48
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
49
|
-
of this software and associated documentation files (the "Software"), to deal
|
50
|
-
in the Software without restriction, including without limitation the rights
|
51
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
52
|
-
copies of the Software, and to permit persons to whom the Software is
|
53
|
-
furnished to do so, subject to the following conditions:
|
54
|
-
|
55
|
-
The above copyright notice and this permission notice shall be included in
|
56
|
-
all copies or substantial portions of the Software.
|
57
|
-
|
58
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
59
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
60
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
61
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
62
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
63
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
64
|
-
THE SOFTWARE.
|
data/Rakefile
DELETED
data/protocol-websocket.gemspec
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
|
2
|
-
require_relative "lib/protocol/websocket/version"
|
3
|
-
|
4
|
-
Gem::Specification.new do |spec|
|
5
|
-
spec.name = "protocol-websocket"
|
6
|
-
spec.version = Protocol::WebSocket::VERSION
|
7
|
-
spec.authors = ["Samuel Williams"]
|
8
|
-
spec.email = ["samuel.williams@oriontransfer.co.nz"]
|
9
|
-
|
10
|
-
spec.summary = "A low level implementation of the WebSocket protocol."
|
11
|
-
spec.homepage = "https://github.com/socketry/protocol-websocket"
|
12
|
-
spec.license = "MIT"
|
13
|
-
|
14
|
-
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
15
|
-
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
16
|
-
end
|
17
|
-
|
18
|
-
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
19
|
-
spec.require_paths = ["lib"]
|
20
|
-
|
21
|
-
spec.add_dependency "protocol-http", "~> 0.2"
|
22
|
-
spec.add_dependency "protocol-http1", "~> 0.2"
|
23
|
-
|
24
|
-
spec.add_development_dependency "covered"
|
25
|
-
spec.add_development_dependency "bundler"
|
26
|
-
spec.add_development_dependency "rake", "~> 10.0"
|
27
|
-
spec.add_development_dependency "rspec", "~> 3.0"
|
28
|
-
end
|