faye 1.3.0 → 1.4.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.
@@ -16,7 +16,8 @@ module Faye
16
16
  def_delegators :@transport, :connection_type
17
17
 
18
18
  attr_accessor :client_id, :timeout
19
- attr_reader :cookies, :endpoint, :headers, :max_request_size, :proxy, :retry, :transports, :ws_extensions
19
+ attr_reader :endpoint, :tls, :headers, :cookies, :proxy, :retry
20
+ attr_reader :max_request_size, :transports, :ws_extensions
20
21
 
21
22
  def initialize(client, endpoint, options)
22
23
  super()
@@ -42,6 +43,8 @@ module Faye
42
43
  add_websocket_extension(extension)
43
44
  end
44
45
 
46
+ @tls = { :verify_peer => true }.merge(options[:tls] || {})
47
+
45
48
  @alternates.each do |type, url|
46
49
  @alternates[type] = URI(url)
47
50
  end
@@ -29,15 +29,15 @@ module Faye
29
29
  private
30
30
 
31
31
  def build_params(content)
32
+ headers = {
33
+ 'Content-Length' => content.bytesize,
34
+ 'Content-Type' => 'application/json',
35
+ 'Host' => @endpoint.host + (@endpoint.port ? ":#{ @endpoint.port }" : '')
36
+ }
37
+
32
38
  params = {
33
- :head => {
34
- 'Content-Length' => content.bytesize,
35
- 'Content-Type' => 'application/json',
36
- 'Host' => @endpoint.host + (@endpoint.port ? ":#{ @endpoint.port }" : '')
37
- }.merge(@dispatcher.headers),
38
-
39
- :body => content,
40
- :timeout => -1 # for em-http-request < 1.0
39
+ :head => headers.merge(@dispatcher.headers),
40
+ :body => content
41
41
  }
42
42
 
43
43
  cookie = get_cookies
@@ -47,10 +47,9 @@ module Faye
47
47
  end
48
48
 
49
49
  def create_request(params)
50
- version = EventMachine::HttpRequest::VERSION.split('.')[0].to_i
51
50
  options = {
52
51
  :inactivity_timeout => 0,
53
- :tls => { :sni_hostname => @endpoint.hostname }
52
+ :tls => @dispatcher.tls
54
53
  }
55
54
 
56
55
  if @proxy[:origin]
@@ -61,12 +60,7 @@ module Faye
61
60
  end
62
61
  end
63
62
 
64
- if version >= 1
65
- client = EventMachine::HttpRequest.new(@endpoint.to_s, options)
66
- else
67
- client = EventMachine::HttpRequest.new(@endpoint.to_s)
68
- end
69
-
63
+ client = EventMachine::HttpRequest.new(@endpoint.to_s, options)
70
64
  client.post(params)
71
65
  end
72
66
 
@@ -72,7 +72,7 @@ module Faye
72
72
  :extensions => extensions,
73
73
  :headers => headers,
74
74
  :proxy => @proxy,
75
- :tls => { :sni_hostname => url.hostname }
75
+ :tls => @dispatcher.tls
76
76
  }
77
77
 
78
78
  socket = Faye::WebSocket::Client.new(url.to_s, [], options)
data/lib/faye.rb CHANGED
@@ -14,7 +14,7 @@ require 'time'
14
14
  require 'uri'
15
15
 
16
16
  module Faye
17
- VERSION = '1.3.0'
17
+ VERSION = '1.4.1'
18
18
 
19
19
  ROOT = File.expand_path(File.dirname(__FILE__))
20
20
 
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faye
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Coglan
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2020-06-08 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: cookiejar
@@ -30,14 +29,14 @@ dependencies:
30
29
  requirements:
31
30
  - - ">="
32
31
  - !ruby/object:Gem::Version
33
- version: 0.3.0
32
+ version: 1.1.6
34
33
  type: :runtime
35
34
  prerelease: false
36
35
  version_requirements: !ruby/object:Gem::Requirement
37
36
  requirements:
38
37
  - - ">="
39
38
  - !ruby/object:Gem::Version
40
- version: 0.3.0
39
+ version: 1.1.6
41
40
  - !ruby/object:Gem::Dependency
42
41
  name: eventmachine
43
42
  requirement: !ruby/object:Gem::Requirement
@@ -58,14 +57,14 @@ dependencies:
58
57
  requirements:
59
58
  - - ">="
60
59
  - !ruby/object:Gem::Version
61
- version: 0.9.1
60
+ version: 0.11.0
62
61
  type: :runtime
63
62
  prerelease: false
64
63
  version_requirements: !ruby/object:Gem::Requirement
65
64
  requirements:
66
65
  - - ">="
67
66
  - !ruby/object:Gem::Version
68
- version: 0.9.1
67
+ version: 0.11.0
69
68
  - !ruby/object:Gem::Dependency
70
69
  name: multi_json
71
70
  requirement: !ruby/object:Gem::Requirement
@@ -346,7 +345,6 @@ dependencies:
346
345
  - - ">="
347
346
  - !ruby/object:Gem::Version
348
347
  version: 4.0.0
349
- description:
350
348
  email: jcoglan@gmail.com
351
349
  executables: []
352
350
  extensions: []
@@ -390,7 +388,6 @@ homepage: https://faye.jcoglan.com
390
388
  licenses:
391
389
  - Apache-2.0
392
390
  metadata: {}
393
- post_install_message:
394
391
  rdoc_options:
395
392
  - "--main"
396
393
  - README.md
@@ -409,8 +406,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
409
406
  - !ruby/object:Gem::Version
410
407
  version: '0'
411
408
  requirements: []
412
- rubygems_version: 3.1.2
413
- signing_key:
409
+ rubygems_version: 3.6.7
414
410
  specification_version: 4
415
411
  summary: Simple pub/sub messaging for the web
416
412
  test_files: []