websocket-client-simple 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/History.txt +8 -1
- data/lib/websocket-client-simple/client.rb +9 -1
- data/lib/websocket-client-simple/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e514163b26ef3c9a5b777947059c009d6b058ae
|
4
|
+
data.tar.gz: 264e3ce953723f8e9e99c6a1bc6a54433f4a6c96
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 852d3a16f5538e187e492410b37c4e46b1aa29eb14d25d0dc2257ce9a2d319d13428eb99fef3a860da647b27e22665a8e185efa21d351bdf03ce0021662670e1
|
7
|
+
data.tar.gz: 2b889144abf61793096c056c0555395c1bf4d1bf23357c29afc1567d5c3fa401e6e0047d78a270e89fc8befc0fbe395868e4ffc281e4f5cb17865aca4e64c8f9
|
data/.travis.yml
CHANGED
data/History.txt
CHANGED
@@ -1,6 +1,13 @@
|
|
1
|
+
=== 0.2.5 2016-02-18
|
2
|
+
|
3
|
+
* bugfixed sending when broken pipe #15
|
4
|
+
* add :verify_mode option for SSL Context #14
|
5
|
+
* thank you for contributing @michaelvilensky
|
6
|
+
|
1
7
|
=== 0.2.4 2015-11-12
|
2
8
|
|
3
|
-
* support handshake headers
|
9
|
+
* support handshake headers #11
|
10
|
+
* thank you for contributing @mathieugagne
|
4
11
|
|
5
12
|
=== 0.2.3 2015-10-26
|
6
13
|
|
@@ -18,11 +18,16 @@ module WebSocket
|
|
18
18
|
if ['https', 'wss'].include? uri.scheme
|
19
19
|
ctx = OpenSSL::SSL::SSLContext.new
|
20
20
|
ctx.ssl_version = options[:ssl_version] || 'SSLv23'
|
21
|
+
ctx.verify_mode = options[:verify_mode] || OpenSSL::SSL::VERIFY_NONE #use VERIFY_PEER for verification
|
22
|
+
cert_store = OpenSSL::X509::Store.new
|
23
|
+
cert_store.set_default_paths
|
24
|
+
ctx.cert_store = cert_store
|
21
25
|
@socket = ::OpenSSL::SSL::SSLSocket.new(@socket, ctx)
|
22
26
|
@socket.connect
|
23
27
|
end
|
24
28
|
@handshake = ::WebSocket::Handshake::Client.new :url => url, :headers => options[:headers]
|
25
29
|
@handshaked = false
|
30
|
+
@pipe_broken = false
|
26
31
|
frame = ::WebSocket::Frame::Incoming::Client.new
|
27
32
|
@closed = false
|
28
33
|
once :__close do |err|
|
@@ -65,13 +70,16 @@ module WebSocket
|
|
65
70
|
begin
|
66
71
|
@socket.write frame.to_s
|
67
72
|
rescue Errno::EPIPE => e
|
73
|
+
@pipe_broken = true
|
68
74
|
emit :__close, e
|
69
75
|
end
|
70
76
|
end
|
71
77
|
|
72
78
|
def close
|
73
79
|
return if @closed
|
74
|
-
|
80
|
+
if !@pipe_broken
|
81
|
+
send nil, :type => :close
|
82
|
+
end
|
75
83
|
@closed = true
|
76
84
|
@socket.close if @socket
|
77
85
|
@socket = nil
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: websocket-client-simple
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sho Hashimoto
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|