websocket-client-simple 0.3.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/test.yml +23 -0
- data/.gitignore +2 -0
- data/History.txt +23 -0
- data/README.md +3 -3
- data/lib/websocket-client-simple/client.rb +10 -2
- data/lib/websocket-client-simple/version.rb +1 -1
- data/websocket-client-simple.gemspec +13 -4
- metadata +17 -13
- data/circle.yml +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: dacb78ebf74e2700e9a33fee5738d6887f89bc1ff75fd0462f13f7fecb6a4c29
|
4
|
+
data.tar.gz: 517d19aedb9257e328ab373321bf994bec148e90993078bd1d9222d16012ddd2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 60c390df8b3a65861e8fb7af48e068a8e2d1f28ae8efa5beb780f8b73d4cff844e9ae22f925f6b5c860946742cfcf91dd138c61ee3f3dd60218bec30c4a57825
|
7
|
+
data.tar.gz: 3e8fccee5f323c77734272dc60bf801d8d58de0c4b53b6d6c4f7f2f6f209dde3940066323eb52bd8de76fdc217a17cb4b0c0e61d0e47f90d93a50139b9025391
|
@@ -0,0 +1,23 @@
|
|
1
|
+
on:
|
2
|
+
push:
|
3
|
+
branches:
|
4
|
+
- "*"
|
5
|
+
pull_request:
|
6
|
+
branches:
|
7
|
+
- "*"
|
8
|
+
schedule:
|
9
|
+
- cron: "0 0 * * 6" # At 00:00 on Saturday
|
10
|
+
jobs:
|
11
|
+
test:
|
12
|
+
runs-on: ubuntu-20.04
|
13
|
+
strategy:
|
14
|
+
matrix:
|
15
|
+
ruby: ["3.1", "3.0", "2.7", "2.6"]
|
16
|
+
name: Ruby ${{ matrix.ruby }}
|
17
|
+
steps:
|
18
|
+
- uses: actions/checkout@v2
|
19
|
+
- uses: ruby/setup-ruby@v1
|
20
|
+
with:
|
21
|
+
ruby-version: ${{ matrix.ruby }}
|
22
|
+
bundler-cache: true
|
23
|
+
- run: bundle exec rake
|
data/.gitignore
CHANGED
data/History.txt
CHANGED
@@ -1,6 +1,29 @@
|
|
1
|
+
=== Not yet released
|
2
|
+
|
3
|
+
=== 0.5.1 2022-01-01
|
4
|
+
|
5
|
+
* Add `closed?` method to `WebSocket::Client::Simple` #8 by @fuyuton
|
6
|
+
* rescue when `OpenSSL::SSL::SSLError` raised #10 by @fuyuton
|
7
|
+
|
8
|
+
=== 0.5.0 2021-12-31
|
9
|
+
|
10
|
+
* Change TLS context defaults to system's default. The previous defaults were ssl_version=SSLv23 and verify_mode=VERIFY_NONE, which are insecure nowadays. #5
|
11
|
+
* thank you for contributing @eagletmt
|
12
|
+
* Made the necessary changes to use SNI. #6
|
13
|
+
* thank you for contributing @fuyuton
|
14
|
+
|
15
|
+
=== 0.4.0 2021-12-30
|
16
|
+
|
17
|
+
* Drop support of ruby 2.5 or older versions as explicit.
|
18
|
+
|
19
|
+
=== 0.3.1 2021-12-30
|
20
|
+
|
21
|
+
* The development of this repository has moved to https://github.com/ruby-jp/websocket-client-simple
|
22
|
+
|
1
23
|
=== 0.3.0 2016-02-20
|
2
24
|
|
3
25
|
* "connect" method runs a given block before connecting WebSocket #12
|
26
|
+
* thank you for suggestion @codekitchen
|
4
27
|
|
5
28
|
=== 0.2.5 2016-02-18
|
6
29
|
|
data/README.md
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
websocket-client-simple
|
2
2
|
=======================
|
3
|
-
Simple WebSocket Client for Ruby
|
3
|
+
Simple WebSocket Client for Ruby (original author: @shokai)
|
4
4
|
|
5
|
-
- https://github.com/
|
5
|
+
- https://github.com/ruby-jp/websocket-client-simple
|
6
6
|
- https://rubygems.org/gems/websocket-client-simple
|
7
7
|
|
8
|
-
[![
|
8
|
+
[![.github/workflows/test.yml](https://github.com/ruby-jp/websocket-client-simple/actions/workflows/test.yml/badge.svg)](https://github.com/ruby-jp/websocket-client-simple/actions/workflows/test.yml)
|
9
9
|
|
10
10
|
Installation
|
11
11
|
------------
|
@@ -21,12 +21,13 @@ module WebSocket
|
|
21
21
|
uri.port || (uri.scheme == 'wss' ? 443 : 80))
|
22
22
|
if ['https', 'wss'].include? uri.scheme
|
23
23
|
ctx = OpenSSL::SSL::SSLContext.new
|
24
|
-
ctx.ssl_version = options[:ssl_version]
|
25
|
-
ctx.verify_mode = options[:verify_mode]
|
24
|
+
ctx.ssl_version = options[:ssl_version] if options[:ssl_version]
|
25
|
+
ctx.verify_mode = options[:verify_mode] if options[:verify_mode]
|
26
26
|
cert_store = OpenSSL::X509::Store.new
|
27
27
|
cert_store.set_default_paths
|
28
28
|
ctx.cert_store = cert_store
|
29
29
|
@socket = ::OpenSSL::SSL::SSLSocket.new(@socket, ctx)
|
30
|
+
@socket.hostname = uri.host
|
30
31
|
@socket.connect
|
31
32
|
end
|
32
33
|
@handshake = ::WebSocket::Handshake::Client.new :url => url, :headers => options[:headers]
|
@@ -76,6 +77,9 @@ module WebSocket
|
|
76
77
|
rescue Errno::EPIPE => e
|
77
78
|
@pipe_broken = true
|
78
79
|
emit :__close, e
|
80
|
+
rescue OpenSSL::SSL::SSLError => e
|
81
|
+
@pipe_broken = true
|
82
|
+
emit :__close, e
|
79
83
|
end
|
80
84
|
end
|
81
85
|
|
@@ -95,6 +99,10 @@ module WebSocket
|
|
95
99
|
@handshake.finished? and !@closed
|
96
100
|
end
|
97
101
|
|
102
|
+
def closed?
|
103
|
+
@closed
|
104
|
+
end
|
105
|
+
|
98
106
|
end
|
99
107
|
|
100
108
|
end
|
@@ -5,19 +5,28 @@ require 'websocket-client-simple/version'
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "websocket-client-simple"
|
7
7
|
spec.version = WebSocket::Client::Simple::VERSION
|
8
|
-
spec.authors = ["Sho Hashimoto"]
|
9
|
-
spec.email = ["hashimoto@shokai.org"]
|
8
|
+
spec.authors = ["Sho Hashimoto", "Yusuke Nakamura"]
|
9
|
+
spec.email = ["hashimoto@shokai.org", "yusuke1994525@gmail.com"]
|
10
10
|
spec.description = %q{Simple WebSocket Client for Ruby}
|
11
11
|
spec.summary = spec.description
|
12
|
-
spec.homepage = "https://github.com/
|
12
|
+
spec.homepage = "https://github.com/ruby-jp/websocket-client-simple"
|
13
13
|
spec.license = "MIT"
|
14
|
+
spec.required_ruby_version = '>= 2.6.9'
|
15
|
+
|
16
|
+
if spec.respond_to?(:metadata)
|
17
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
18
|
+
spec.metadata["source_code_uri"] = spec.homepage
|
19
|
+
spec.metadata["changelog_uri"] = "https://github.com/ruby-jp/websocket-client-simple/blob/master/History.txt"
|
20
|
+
end
|
21
|
+
|
22
|
+
spec.post_install_message = "The development of this gem has moved to #{spec.homepage}."
|
14
23
|
|
15
24
|
spec.files = `git ls-files`.split($/).reject{|f| f == "Gemfile.lock" }
|
16
25
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
17
26
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
27
|
spec.require_paths = ["lib"]
|
19
28
|
|
20
|
-
spec.add_development_dependency "bundler"
|
29
|
+
spec.add_development_dependency "bundler"
|
21
30
|
spec.add_development_dependency "rake"
|
22
31
|
spec.add_development_dependency "minitest"
|
23
32
|
spec.add_development_dependency "websocket-eventmachine-server"
|
metadata
CHANGED
@@ -1,29 +1,30 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: websocket-client-simple
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sho Hashimoto
|
8
|
+
- Yusuke Nakamura
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date:
|
12
|
+
date: 2022-01-01 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: bundler
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
16
17
|
requirements:
|
17
|
-
- - "
|
18
|
+
- - ">="
|
18
19
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
20
|
+
version: '0'
|
20
21
|
type: :development
|
21
22
|
prerelease: false
|
22
23
|
version_requirements: !ruby/object:Gem::Requirement
|
23
24
|
requirements:
|
24
|
-
- - "
|
25
|
+
- - ">="
|
25
26
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
27
|
+
version: '0'
|
27
28
|
- !ruby/object:Gem::Dependency
|
28
29
|
name: rake
|
29
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -111,17 +112,18 @@ dependencies:
|
|
111
112
|
description: Simple WebSocket Client for Ruby
|
112
113
|
email:
|
113
114
|
- hashimoto@shokai.org
|
115
|
+
- yusuke1994525@gmail.com
|
114
116
|
executables: []
|
115
117
|
extensions: []
|
116
118
|
extra_rdoc_files: []
|
117
119
|
files:
|
120
|
+
- ".github/workflows/test.yml"
|
118
121
|
- ".gitignore"
|
119
122
|
- Gemfile
|
120
123
|
- History.txt
|
121
124
|
- LICENSE.txt
|
122
125
|
- README.md
|
123
126
|
- Rakefile
|
124
|
-
- circle.yml
|
125
127
|
- lib/websocket-client-simple.rb
|
126
128
|
- lib/websocket-client-simple/client.rb
|
127
129
|
- lib/websocket-client-simple/version.rb
|
@@ -134,11 +136,14 @@ files:
|
|
134
136
|
- test/test_helper.rb
|
135
137
|
- test/test_websocket_client_simple.rb
|
136
138
|
- websocket-client-simple.gemspec
|
137
|
-
homepage: https://github.com/
|
139
|
+
homepage: https://github.com/ruby-jp/websocket-client-simple
|
138
140
|
licenses:
|
139
141
|
- MIT
|
140
|
-
metadata:
|
141
|
-
|
142
|
+
metadata:
|
143
|
+
homepage_uri: https://github.com/ruby-jp/websocket-client-simple
|
144
|
+
source_code_uri: https://github.com/ruby-jp/websocket-client-simple
|
145
|
+
changelog_uri: https://github.com/ruby-jp/websocket-client-simple/blob/master/History.txt
|
146
|
+
post_install_message: The development of this gem has moved to https://github.com/ruby-jp/websocket-client-simple.
|
142
147
|
rdoc_options: []
|
143
148
|
require_paths:
|
144
149
|
- lib
|
@@ -146,15 +151,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
146
151
|
requirements:
|
147
152
|
- - ">="
|
148
153
|
- !ruby/object:Gem::Version
|
149
|
-
version:
|
154
|
+
version: 2.6.9
|
150
155
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
151
156
|
requirements:
|
152
157
|
- - ">="
|
153
158
|
- !ruby/object:Gem::Version
|
154
159
|
version: '0'
|
155
160
|
requirements: []
|
156
|
-
|
157
|
-
rubygems_version: 2.4.5
|
161
|
+
rubygems_version: 3.1.6
|
158
162
|
signing_key:
|
159
163
|
specification_version: 4
|
160
164
|
summary: Simple WebSocket Client for Ruby
|
data/circle.yml
DELETED