websocket-client-simple 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/History.txt +10 -0
- data/README.md +1 -2
- data/lib/websocket-client-simple/client.rb +9 -1
- data/lib/websocket-client-simple/version.rb +1 -1
- data/sample/client.rb +0 -1
- data/sample/webbrowser/index.html +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2de6863ed3ec4f702c28cb4143bb949facf6fd18efda61eb236410131cb4dfa7
|
4
|
+
data.tar.gz: a5ebee3d4e74eb177ad70ea111497b2c4aa515ed6ddff523ff0840f7bd0355ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25239fc6f496ff3838112f1b6360a52d6be6d651fc3354ae7e61cdae3712cfe491d870c5af6874583e42fead682420f9757dee1483391f9df31b5c25b4a921c2
|
7
|
+
data.tar.gz: 3fc6b6f1abbb20157f58a80d9fb47bb65ace236620ca786bb7eaae3fd51b134be15bd4e2b34ecbc5a7f2fa94cfd9c392b583f29bc335c359eb749bcccf607d72
|
data/History.txt
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
=== Not yet released
|
2
2
|
|
3
|
+
== 0.6.0 2022-09-22
|
4
|
+
|
5
|
+
* Add option `cert_store` for passing cert store to SSLSocket context #12 by @DerekStride
|
6
|
+
* Set `OpenSSL::SSL::SSLSocket#sync_close` to `true` #12 by @DerekStride
|
7
|
+
|
8
|
+
=== 0.5.1 2022-01-01
|
9
|
+
|
10
|
+
* Add `closed?` method to `WebSocket::Client::Simple` #8 by @fuyuton
|
11
|
+
* rescue when `OpenSSL::SSL::SSLError` raised #10 by @fuyuton
|
12
|
+
|
3
13
|
=== 0.5.0 2021-12-31
|
4
14
|
|
5
15
|
* 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
|
data/README.md
CHANGED
@@ -16,7 +16,6 @@ Installation
|
|
16
16
|
Usage
|
17
17
|
-----
|
18
18
|
```ruby
|
19
|
-
require 'rubygems'
|
20
19
|
require 'websocket-client-simple'
|
21
20
|
|
22
21
|
ws = WebSocket::Client::Simple.connect 'ws://example.com:8888'
|
@@ -60,7 +59,7 @@ end
|
|
60
59
|
|
61
60
|
Sample
|
62
61
|
------
|
63
|
-
[websocket chat](https://github.com/
|
62
|
+
[websocket chat](https://github.com/ruby-jp/websocket-client-simple/tree/master/sample)
|
64
63
|
|
65
64
|
|
66
65
|
Test
|
@@ -23,10 +23,11 @@ module WebSocket
|
|
23
23
|
ctx = OpenSSL::SSL::SSLContext.new
|
24
24
|
ctx.ssl_version = options[:ssl_version] if options[:ssl_version]
|
25
25
|
ctx.verify_mode = options[:verify_mode] if options[:verify_mode]
|
26
|
-
cert_store = OpenSSL::X509::Store.new
|
26
|
+
cert_store = options[: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.sync_close = true
|
30
31
|
@socket.hostname = uri.host
|
31
32
|
@socket.connect
|
32
33
|
end
|
@@ -77,6 +78,9 @@ module WebSocket
|
|
77
78
|
rescue Errno::EPIPE => e
|
78
79
|
@pipe_broken = true
|
79
80
|
emit :__close, e
|
81
|
+
rescue OpenSSL::SSL::SSLError => e
|
82
|
+
@pipe_broken = true
|
83
|
+
emit :__close, e
|
80
84
|
end
|
81
85
|
end
|
82
86
|
|
@@ -96,6 +100,10 @@ module WebSocket
|
|
96
100
|
@handshake.finished? and !@closed
|
97
101
|
end
|
98
102
|
|
103
|
+
def closed?
|
104
|
+
@closed
|
105
|
+
end
|
106
|
+
|
99
107
|
end
|
100
108
|
|
101
109
|
end
|
data/sample/client.rb
CHANGED
@@ -16,7 +16,7 @@
|
|
16
16
|
<ul id="chat"></ul>
|
17
17
|
<div id="footer">
|
18
18
|
<hr>
|
19
|
-
<a href="https://github.com/
|
19
|
+
<a href="https://github.com/ruby-jp/websocket-client-simple">https://github.com/ruby-jp/websocket-client-simple</a>
|
20
20
|
</div>
|
21
21
|
</body>
|
22
22
|
</html>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sho Hashimoto
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2022-09-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|