websocket-client-simple 0.5.1 → 0.6.1
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 +9 -0
- data/README.md +1 -2
- data/lib/websocket-client-simple/client.rb +3 -2
- 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: 21d4caf0f550f6beb5276442fd90f9e0d6bbc4a4cd9c08ca8eef12472ebd072e
|
4
|
+
data.tar.gz: 312f88a43ce512fc4953ffd32b6c28c9560a8839fd4fbb37b2d2feae4b7d612e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '045560966b35fa3972609406742d61ba8e8cf60f04aa4dbaffa8cf5d4e507f5a2e56f68c4b2a01f5f3a536d38980bf446de5f3a35841ba16b1e704936283fd6b'
|
7
|
+
data.tar.gz: cd43f68e8725afdd6346dafed3a676f0852067030411aab97051c4e0550011be09c559f8d0125e1c68fdc5bafeeaf24a6794e5bcf93b382a7795b7d8e5287cd5
|
data/History.txt
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
=== Not yet released
|
2
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
|
+
|
3
12
|
=== 0.5.1 2022-01-01
|
4
13
|
|
5
14
|
* Add `closed?` method to `WebSocket::Client::Simple` #8 by @fuyuton
|
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
|
@@ -96,7 +97,7 @@ module WebSocket
|
|
96
97
|
end
|
97
98
|
|
98
99
|
def open?
|
99
|
-
@handshake
|
100
|
+
@handshake&.finished? and !@closed
|
100
101
|
end
|
101
102
|
|
102
103
|
def closed?
|
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.1
|
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: 2023-03-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|