websocket-eventmachine-client 1.1.0 → 1.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: bf7ffbade416b4c84219e2277f22ef31f0755778
4
- data.tar.gz: 9178f2572d0b033c0d44f6f6925faf0ef07e89fa
3
+ metadata.gz: c79efbc5ca7777083632533f4495bfe97a7a7620
4
+ data.tar.gz: 6a39986df45187e9b931996fb30f1e0729556217
5
5
  SHA512:
6
- metadata.gz: 7dc1c07da7158d64d095702b6f742e0f610b4eae2712445ede2346bc2f7ed1314f2dfd81999183b9d929da71d284b0a28c2f681f551fd41c02a2854b1eb1f08b
7
- data.tar.gz: eea80e6a5c18d4064a92886259eb5a8b0ec309087da9c753199825ed0dc03fd50b01e45f7d965b3f37ddf663d15450a34114980aa98bfedee6bcdf5baab87361
6
+ metadata.gz: 46ad7f7786e39411f2d6db934491d355a9a4736e2bdcc61125c5605d45a3ae5f94029324174be4422dcc4a87f16198c890787d7335a2c455dbbddc02907a9710
7
+ data.tar.gz: 5b711ff0d284a0af45ad2ce60fb17652a11ae07fdaade33cf448679ae8dfae3b931da09e30fd9487d4df3624f08c03cf67480b267cdf396f477754826a25c187
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.2.0
4
+
5
+ - support for unix domain connection
6
+
3
7
  ## 1.1.0
4
8
 
5
9
  - ssl support
data/README.md CHANGED
@@ -43,6 +43,19 @@ EM.run do
43
43
  end
44
44
  ```
45
45
 
46
+ ### UNIX Domain client
47
+
48
+ You can connect to a local UNIX domain socket instead of a remote `TCP` socket using `connect_unix_domain`:
49
+
50
+ ```ruby
51
+ EM.run do
52
+ ws = WebSocket::EventMachine::Client.connect_unix_domain('/var/run/wss.sock')
53
+ # . . .
54
+ end
55
+ ```
56
+
57
+ You can optionally specify the `:version`, `:headers`, and `:ssl` options to the method.
58
+
46
59
  ## Options
47
60
 
48
61
  Following options can be passed to WebSocket::EventMachine::Client initializer:
@@ -158,7 +171,7 @@ Sends message to server.
158
171
 
159
172
  Parameters:
160
173
 
161
- - `[String] message` - message that should be sent to client
174
+ - `[String] message` - message that should be sent to server
162
175
  - `[Hash] params` - params for message(optional)
163
176
  - `[Symbol] :type` - type of message. Valid values are :text, :binary(default is :text)
164
177
 
@@ -19,6 +19,7 @@ module WebSocket
19
19
  # @param args [Hash] The request arguments
20
20
  # @option args [String] :host The host IP/DNS name
21
21
  # @option args [Integer] :port The port to connect too(default = 80)
22
+ # @option args [String] :uri Full URI for server(optional - use instead of host/port combination)
22
23
  # @option args [Integer] :version Version of protocol to use(default = 13)
23
24
  # @option args [Hash] :headers HTTP headers to use in the handshake
24
25
  # @option args [Boolean] :ssl Force SSL/TLS connection
@@ -41,6 +42,17 @@ module WebSocket
41
42
 
42
43
  ::EventMachine.connect host, port, self, args
43
44
  end
45
+
46
+ # Make a websocket connection to a UNIX-domain socket.
47
+ # @param socketname [String] Unix domain socket (local fully-qualified path)
48
+ # @param args [Hash] Arguments for connection
49
+ # @option args [Integer] :version Version of protocol to use(default = 13)
50
+ # @option args [Hash] :headers HTTP headers to use in the handshake
51
+ def self.connect_unix_domain(socketname, args = {})
52
+ fail ArgumentError, 'invalid socket' unless File.socket?(socketname)
53
+ args[:host] ||= 'localhost'
54
+ ::EventMachine.connect_unix_domain socketname, self, args
55
+ end
44
56
 
45
57
  # Initialize connection
46
58
  # @param args [Hash] Arguments for connection
@@ -125,7 +137,7 @@ module WebSocket
125
137
  # message - string with ping message
126
138
  def onping(&blk); super; end
127
139
 
128
- # Called when pond message is received
140
+ # Called when pong message is received
129
141
  # One parameter passed to block:
130
142
  # message - string with pong message
131
143
  def onpong(&blk); super; end
@@ -1,7 +1,7 @@
1
1
  module WebSocket
2
2
  module EventMachine
3
3
  class Client
4
- VERSION = '1.1.0'
4
+ VERSION = '1.2.0'
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-eventmachine-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bernard Potocki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-10 00:00:00.000000000 Z
11
+ date: 2016-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: websocket-eventmachine-base
@@ -62,7 +62,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
62
62
  version: '0'
63
63
  requirements: []
64
64
  rubyforge_project:
65
- rubygems_version: 2.2.2
65
+ rubygems_version: 2.5.1
66
66
  signing_key:
67
67
  specification_version: 4
68
68
  summary: WebSocket client for Ruby