websocket-client-simple 0.1.0 → 0.2.0

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: b4ea337a582d882d5b994ae917ead5f8bb7d8366
4
- data.tar.gz: c5ba071b095d13b4d2e0a94b5d005f5bb0d40e83
3
+ metadata.gz: 55688e16522e47832ad30b817519536685ff275e
4
+ data.tar.gz: 7b7e37ba6c26e4b855072ce7983d30855b835a8a
5
5
  SHA512:
6
- metadata.gz: ce374970d37e555925969ef5bb6c126c5020e0fdd3743d6a996604802b1751620819984c40efc7bb8d5749fc25e23930c5f9ec8f88ad57577623a423cb3d3773
7
- data.tar.gz: 60453f1fcb3df824ffcbc88f099d38dbb2576c8a4b14a208d44ce2157bed2b3f2f23d0236e041410b62188c099d9f46506ac5d742a445b1225b557fe45397210
6
+ metadata.gz: ef90ae275aaf760c9ec85049ff07ec636cd0cf219cc037f0d945adc7ebb3b9621df04263e229e7b70ced6617e9fab037d259ae34035e74b210ae2b0498e2234d
7
+ data.tar.gz: f68f2fd5dd689582f06f758569f71a9f09a69e23655aeb86d974a68cc77bf79d6e9bea83e7d996c994d26c59536220d5562efee6d63c46589a0e042f3992d7cf
data/History.txt CHANGED
@@ -1,3 +1,8 @@
1
+ === 0.2.0 2014-06-07
2
+
3
+ * SSL support with wss:// and https:// scheme
4
+ * thank you for contributing @mallowlabs
5
+
1
6
  === 0.1.0 2014-05-08
2
7
 
3
8
  * add accessor Client#handshake #5
@@ -13,7 +13,12 @@ module WebSocket
13
13
  def initialize(url)
14
14
  @url = url
15
15
  uri = URI.parse url
16
- @socket = TCPSocket.new(uri.host, uri.port || 80)
16
+ @socket = TCPSocket.new(uri.host,
17
+ uri.port || (uri.scheme == 'wss' ? 443 : 80))
18
+ if ['https', 'wss'].include? uri.scheme
19
+ @socket = ::OpenSSL::SSL::SSLSocket.new(@socket)
20
+ @socket.connect
21
+ end
17
22
  @handshake = ::WebSocket::Handshake::Client.new :url => url
18
23
  @handshaked = false
19
24
  frame = ::WebSocket::Frame::Incoming::Client.new
@@ -1,7 +1,7 @@
1
1
  module WebSocket
2
2
  module Client
3
3
  module Simple
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
6
6
  end
7
7
  end
@@ -1,6 +1,7 @@
1
1
  require 'event_emitter'
2
2
  require 'websocket'
3
3
  require 'socket'
4
+ require 'openssl'
4
5
  require 'uri'
5
6
 
6
7
  require 'websocket-client-simple/version'
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.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sho Hashimoto
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-08 00:00:00.000000000 Z
11
+ date: 2014-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler