websocket-client-simple 0.6.1 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +3 -3
- data/CHANGELOG.md +88 -0
- data/lib/websocket-client-simple/client.rb +2 -1
- data/lib/websocket-client-simple/version.rb +1 -1
- data/test/test_connect_block.rb +6 -6
- data/test/test_websocket_client_simple.rb +1 -1
- data/websocket-client-simple.gemspec +1 -1
- metadata +7 -7
- data/History.txt +0 -107
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7589c208daf3fa057d52cc788dafa63401a1c71dd20413d95e8eae0b42a09251
|
4
|
+
data.tar.gz: 53a1bed22541edce6f7d64ae140873a8d6b454f854f39c9a7a85ac4bcc78313b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c80ac0a53fde73ed53bbe6149b911ffbe053f056d87423700dd58fc4bade8a06aa630ec48b0e6018f6ab7d093e2394d590f407e00c019629061b24f1e05ab6f
|
7
|
+
data.tar.gz: fa4c287824fafab4bbca6abc7c23c1a3ca8bb0ff1c0381614f2e579605951870bf2c2850c48bb0c599ae1bb20cc81a319202a89aebe93691e57dccad2bdd6f98
|
data/.github/workflows/test.yml
CHANGED
@@ -9,13 +9,13 @@ on:
|
|
9
9
|
- cron: "0 0 * * 6" # At 00:00 on Saturday
|
10
10
|
jobs:
|
11
11
|
test:
|
12
|
-
runs-on: ubuntu-
|
12
|
+
runs-on: ubuntu-22.04
|
13
13
|
strategy:
|
14
14
|
matrix:
|
15
|
-
ruby: ["3.1", "3.0", "2.7", "2.6"]
|
15
|
+
ruby: ["3.2", "3.1", "3.0", "2.7", "2.6"]
|
16
16
|
name: Ruby ${{ matrix.ruby }}
|
17
17
|
steps:
|
18
|
-
- uses: actions/checkout@
|
18
|
+
- uses: actions/checkout@v3
|
19
19
|
- uses: ruby/setup-ruby@v1
|
20
20
|
with:
|
21
21
|
ruby-version: ${{ matrix.ruby }}
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,88 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
## Not yet released
|
4
|
+
|
5
|
+
## 0.8.0 - 2023-08-08
|
6
|
+
* Set `WebSocket.should_raise = true` https://github.com/ruby-jp/websocket-client-simple/pull/25 by @jlaffaye
|
7
|
+
|
8
|
+
## 0.7.0 - 2023-08-04
|
9
|
+
* Expose add accessor `Client#thread` #22 by @jlaffaye
|
10
|
+
* Rewrite changelog as a Markdown
|
11
|
+
|
12
|
+
## 0.6.1 - 2023-03-10
|
13
|
+
* Make `#open?` safe to use when `@handshake` is `nil` #20 by @cyberarm
|
14
|
+
|
15
|
+
## 0.6.0 - 2022-09-22
|
16
|
+
* Add option `cert_store` for passing cert store to SSLSocket context #12 by @DerekStride
|
17
|
+
* Set `OpenSSL::SSL::SSLSocket#sync_close` to `true` #12 by @DerekStride
|
18
|
+
|
19
|
+
## 0.5.1 - 2022-01-01
|
20
|
+
* Add `closed?` method to `WebSocket::Client::Simple` #8 by @fuyuton
|
21
|
+
* rescue when `OpenSSL::SSL::SSLError` raised #10 by @fuyuton
|
22
|
+
|
23
|
+
## 0.5.0 - 2021-12-31
|
24
|
+
* 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
|
25
|
+
* thank you for contributing @eagletmt
|
26
|
+
* Made the necessary changes to use SNI. #6
|
27
|
+
* thank you for contributing @fuyuton
|
28
|
+
|
29
|
+
## 0.4.0 - 2021-12-30
|
30
|
+
* Drop support of ruby 2.5 or older versions as explicit.
|
31
|
+
|
32
|
+
## 0.3.1 - 2021-12-30
|
33
|
+
* The development of this repository has moved to https://github.com/ruby-jp/websocket-client-simple
|
34
|
+
|
35
|
+
## 0.3.0 - 2016-12-30
|
36
|
+
* `connect` method runs a given block before connecting WebSocket [#12](https://github.com/shokai/websocket-client-simple/issues/12)
|
37
|
+
* thank you for suggestion @codekitchen
|
38
|
+
|
39
|
+
## 0.2.5 - 2016-02-18
|
40
|
+
* bugfixed sending when broken pipe [#15](https://github.com/shokai/websocket-client-simple/pull/15)
|
41
|
+
* add `:verify_mode` option for SSL Context [#14](https://github.com/shokai/websocket-client-simple/pull/14)
|
42
|
+
* thank you for contributing @michaelvilensky
|
43
|
+
|
44
|
+
## 0.2.4 - 2015-11-12
|
45
|
+
* support handshake headers [#11](https://github.com/shokai/websocket-client-simple/pull/11)
|
46
|
+
* thank you for contributing @mathieugagne
|
47
|
+
|
48
|
+
## 0.2.3 - 2015-10-26
|
49
|
+
* kill thread at end of method [#10](https://github.com/shokai/websocket-client-simple/pull/10)
|
50
|
+
* thank you for contributing @hansy
|
51
|
+
|
52
|
+
## 0.2.2 - 2014-11-18
|
53
|
+
* bugfix socket reading
|
54
|
+
|
55
|
+
## 0.2.0 - 2014-06-07
|
56
|
+
* SSL support with `wss://` and `https://` scheme [#6](https://github.com/shokai/websocket-client-simple/pull/6)
|
57
|
+
* thank you for contributing @mallowlabs
|
58
|
+
|
59
|
+
## 0.1.0 - 2014-05-08
|
60
|
+
* add accessor `Client#handshake` [#5](https://github.com/shokai/websocket-client-simple/issues/5)
|
61
|
+
* bugfix socket reading
|
62
|
+
|
63
|
+
## 0.0.9 - 2014-04-03
|
64
|
+
* emit `error` in receive thread
|
65
|
+
* rescue only `Errno::EPIPE`, not all Errors
|
66
|
+
|
67
|
+
## 0.0.8 - 2014-01-29
|
68
|
+
* bugfix `Client#close` #4
|
69
|
+
|
70
|
+
## 0.0.7 - 2014-01-29
|
71
|
+
* send CLOSE frame in `Client#close` [#4](https://github.com/shokai/websocket-client-simple/issues/4)
|
72
|
+
## 0.0.6 - 2014-01-17
|
73
|
+
* add function `Client#open?`
|
74
|
+
|
75
|
+
## 0.0.5 - 2013-03-23
|
76
|
+
* kill read thread on close
|
77
|
+
|
78
|
+
## 0.0.4 - 2013-03-23
|
79
|
+
* fix sample and README
|
80
|
+
|
81
|
+
## 0.0.3 - 2013-03-23
|
82
|
+
* `:type => :text` option in send
|
83
|
+
|
84
|
+
## 0.0.2 - 2013-03-22
|
85
|
+
* remove unnecessary sleep
|
86
|
+
|
87
|
+
## 0.0.1 - 2013-03-22
|
88
|
+
* release
|
@@ -11,7 +11,7 @@ module WebSocket
|
|
11
11
|
|
12
12
|
class Client
|
13
13
|
include EventEmitter
|
14
|
-
attr_reader :url, :handshake
|
14
|
+
attr_reader :url, :handshake, :thread
|
15
15
|
|
16
16
|
def connect(url, options={})
|
17
17
|
return if @socket
|
@@ -31,6 +31,7 @@ module WebSocket
|
|
31
31
|
@socket.hostname = uri.host
|
32
32
|
@socket.connect
|
33
33
|
end
|
34
|
+
::WebSocket.should_raise = true
|
34
35
|
@handshake = ::WebSocket::Handshake::Client.new :url => url, :headers => options[:headers]
|
35
36
|
@handshaked = false
|
36
37
|
@pipe_broken = false
|
data/test/test_connect_block.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
require File.expand_path 'test_helper', File.dirname(__FILE__)
|
2
2
|
|
3
|
-
class TestWebSocketClientSimple <
|
4
|
-
|
3
|
+
class TestWebSocketClientSimple < Minitest::Test
|
4
|
+
|
5
5
|
def test_onopen
|
6
|
-
|
6
|
+
|
7
7
|
EM::run{
|
8
|
-
|
8
|
+
|
9
9
|
EchoServer.start
|
10
10
|
|
11
11
|
res = nil
|
@@ -27,7 +27,7 @@ class TestWebSocketClientSimple < MiniTest::Test
|
|
27
27
|
EM::stop_event_loop
|
28
28
|
end
|
29
29
|
}
|
30
|
-
|
30
|
+
|
31
31
|
end
|
32
|
-
|
32
|
+
|
33
33
|
end
|
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
|
|
16
16
|
if spec.respond_to?(:metadata)
|
17
17
|
spec.metadata["homepage_uri"] = spec.homepage
|
18
18
|
spec.metadata["source_code_uri"] = spec.homepage
|
19
|
-
spec.metadata["changelog_uri"] = "https://github.com/ruby-jp/websocket-client-simple/blob/master/
|
19
|
+
spec.metadata["changelog_uri"] = "https://github.com/ruby-jp/websocket-client-simple/blob/master/CHANGELOG.md"
|
20
20
|
end
|
21
21
|
|
22
22
|
spec.post_install_message = "The development of this gem has moved to #{spec.homepage}."
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
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.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sho Hashimoto
|
8
8
|
- Yusuke Nakamura
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-
|
12
|
+
date: 2023-08-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -119,8 +119,8 @@ extra_rdoc_files: []
|
|
119
119
|
files:
|
120
120
|
- ".github/workflows/test.yml"
|
121
121
|
- ".gitignore"
|
122
|
+
- CHANGELOG.md
|
122
123
|
- Gemfile
|
123
|
-
- History.txt
|
124
124
|
- LICENSE.txt
|
125
125
|
- README.md
|
126
126
|
- Rakefile
|
@@ -142,7 +142,7 @@ licenses:
|
|
142
142
|
metadata:
|
143
143
|
homepage_uri: https://github.com/ruby-jp/websocket-client-simple
|
144
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/
|
145
|
+
changelog_uri: https://github.com/ruby-jp/websocket-client-simple/blob/master/CHANGELOG.md
|
146
146
|
post_install_message: The development of this gem has moved to https://github.com/ruby-jp/websocket-client-simple.
|
147
147
|
rdoc_options: []
|
148
148
|
require_paths:
|
@@ -158,8 +158,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
158
158
|
- !ruby/object:Gem::Version
|
159
159
|
version: '0'
|
160
160
|
requirements: []
|
161
|
-
rubygems_version: 3.
|
162
|
-
signing_key:
|
161
|
+
rubygems_version: 3.3.7
|
162
|
+
signing_key:
|
163
163
|
specification_version: 4
|
164
164
|
summary: Simple WebSocket Client for Ruby
|
165
165
|
test_files:
|
data/History.txt
DELETED
@@ -1,107 +0,0 @@
|
|
1
|
-
=== Not yet released
|
2
|
-
|
3
|
-
== 0.6.1 2023-03-10
|
4
|
-
|
5
|
-
* Make #open? safe to use when `@handshake` is `nil` #20 by @cyberarm
|
6
|
-
|
7
|
-
== 0.6.0 2022-09-22
|
8
|
-
|
9
|
-
* Add option `cert_store` for passing cert store to SSLSocket context #12 by @DerekStride
|
10
|
-
* Set `OpenSSL::SSL::SSLSocket#sync_close` to `true` #12 by @DerekStride
|
11
|
-
|
12
|
-
=== 0.5.1 2022-01-01
|
13
|
-
|
14
|
-
* Add `closed?` method to `WebSocket::Client::Simple` #8 by @fuyuton
|
15
|
-
* rescue when `OpenSSL::SSL::SSLError` raised #10 by @fuyuton
|
16
|
-
|
17
|
-
=== 0.5.0 2021-12-31
|
18
|
-
|
19
|
-
* 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
|
20
|
-
* thank you for contributing @eagletmt
|
21
|
-
* Made the necessary changes to use SNI. #6
|
22
|
-
* thank you for contributing @fuyuton
|
23
|
-
|
24
|
-
=== 0.4.0 2021-12-30
|
25
|
-
|
26
|
-
* Drop support of ruby 2.5 or older versions as explicit.
|
27
|
-
|
28
|
-
=== 0.3.1 2021-12-30
|
29
|
-
|
30
|
-
* The development of this repository has moved to https://github.com/ruby-jp/websocket-client-simple
|
31
|
-
|
32
|
-
=== 0.3.0 2016-02-20
|
33
|
-
|
34
|
-
* "connect" method runs a given block before connecting WebSocket #12
|
35
|
-
* thank you for suggestion @codekitchen
|
36
|
-
|
37
|
-
=== 0.2.5 2016-02-18
|
38
|
-
|
39
|
-
* bugfixed sending when broken pipe #15
|
40
|
-
* add :verify_mode option for SSL Context #14
|
41
|
-
* thank you for contributing @michaelvilensky
|
42
|
-
|
43
|
-
=== 0.2.4 2015-11-12
|
44
|
-
|
45
|
-
* support handshake headers #11
|
46
|
-
* thank you for contributing @mathieugagne
|
47
|
-
|
48
|
-
=== 0.2.3 2015-10-26
|
49
|
-
|
50
|
-
* kill thread at end of method
|
51
|
-
* thank you for contributing @hansy
|
52
|
-
|
53
|
-
=== 0.2.2 2014-11-18
|
54
|
-
|
55
|
-
* add :ssl_version option to specify version of SSL/TLS
|
56
|
-
* thank you for contributing @tonybyrne
|
57
|
-
|
58
|
-
=== 0.2.1 2014-10-19
|
59
|
-
|
60
|
-
* bugfix socket reading
|
61
|
-
|
62
|
-
=== 0.2.0 2014-06-07
|
63
|
-
|
64
|
-
* SSL support with wss:// and https:// scheme
|
65
|
-
* thank you for contributing @mallowlabs
|
66
|
-
|
67
|
-
=== 0.1.0 2014-05-08
|
68
|
-
|
69
|
-
* add accessor Client#handshake #5
|
70
|
-
* bugfix socket reading
|
71
|
-
|
72
|
-
=== 0.0.9 2014-04-03
|
73
|
-
|
74
|
-
* emit "error" in receive thread
|
75
|
-
* rescue only Errno::EPIPE, not all Errors
|
76
|
-
|
77
|
-
=== 0.0.8 2014-01-29
|
78
|
-
|
79
|
-
* bugfix Client#close #4
|
80
|
-
|
81
|
-
=== 0.0.7 2014-01-29
|
82
|
-
|
83
|
-
* send CLOSE frame in Client#close #4
|
84
|
-
|
85
|
-
=== 0.0.6 2014-01-17
|
86
|
-
|
87
|
-
* add function Client#open?
|
88
|
-
|
89
|
-
=== 0.0.5 2013-03-23
|
90
|
-
|
91
|
-
* kill read thread on close
|
92
|
-
|
93
|
-
=== 0.0.4 2013-03-23
|
94
|
-
|
95
|
-
* fix sample and README
|
96
|
-
|
97
|
-
=== 0.0.3 2013-03-23
|
98
|
-
|
99
|
-
* :type => :text option in send
|
100
|
-
|
101
|
-
=== 0.0.2 2013-03-22
|
102
|
-
|
103
|
-
* remove unnecessary sleep
|
104
|
-
|
105
|
-
=== 0.0.1 2013-03-22
|
106
|
-
|
107
|
-
* release
|