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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 623aead32607d8c834bc65df09362499318de0d2
4
- data.tar.gz: 253e82d0aa89a3824f54a7b1847aa07bb5ca2510
3
+ metadata.gz: 2e514163b26ef3c9a5b777947059c009d6b058ae
4
+ data.tar.gz: 264e3ce953723f8e9e99c6a1bc6a54433f4a6c96
5
5
  SHA512:
6
- metadata.gz: 75f6f89f7bffe9451a9a9c2bdfe1fd32d7b126e6d34e92c47d6cfebb66a31b62c26d4cebbb9e8e8b7df2213f165daf0ef3831bdc768bb7215ed5914997e4e404
7
- data.tar.gz: 10deab6207a36de46133049bfa14f619caedb53d6f475294bd5196c6403d7eb0c458afe3fb42315758597430ea02d9fff0752166ccb6b934131e70d079683725
6
+ metadata.gz: 852d3a16f5538e187e492410b37c4e46b1aa29eb14d25d0dc2257ce9a2d319d13428eb99fef3a860da647b27e22665a8e185efa21d351bdf03ce0021662670e1
7
+ data.tar.gz: 2b889144abf61793096c056c0555395c1bf4d1bf23357c29afc1567d5c3fa401e6e0047d78a270e89fc8befc0fbe395868e4ffc281e4f5cb17865aca4e64c8f9
data/.travis.yml CHANGED
@@ -1,3 +1,4 @@
1
+ sudo: false
1
2
  language: ruby
2
3
  rvm:
3
4
  - '2.1.2'
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
- send nil, :type => :close
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
@@ -1,7 +1,7 @@
1
1
  module WebSocket
2
2
  module Client
3
3
  module Simple
4
- VERSION = "0.2.4"
4
+ VERSION = "0.2.5"
5
5
  end
6
6
  end
7
7
  end
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
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: 2015-11-11 00:00:00.000000000 Z
11
+ date: 2016-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler