faye-websocket 0.11.4 → 0.13.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0c3384e7d351fe50445411adad98b0b8dca9b7118de8b601577f5c36bcbee6ad
4
- data.tar.gz: c2ed4e66cdc6e0956f2b45e26d00c222918c18a2a8c2d8c76f563d563ff4d1de
3
+ metadata.gz: f7f6e4a36da5e7abb23367c5cdc67313fa9f8183e7cbb113141d95c9d7a320dc
4
+ data.tar.gz: 496722f6c8b15f286d31e25bd27f9699fa66842e781fa7bc2de3a0650d3cf5cd
5
5
  SHA512:
6
- metadata.gz: 8f60883a4d084ab638a7315cda51dc7ae24294b1b7fecd901c54a467b45ff3219a17c695af01a51aba1c24dea4825b90816df0f7751e1338efe681df2535829d
7
- data.tar.gz: 6cf017b5a8055ce54fbfc7ff9705c8e702e1c3371030220e17ccf3633975ed554dc4849097204ab1d57843810555788aa47e9e7ee0c6e8a06e768e5b7273b00c
6
+ metadata.gz: c26f0eda321c8c5479d21dc3e9ef4beeb8af728a963a2854fc13902841f53d5dcb049bdecb83793437e9dec86e2baf79103c9cc2f23f55e36db36aef543ab948
7
+ data.tar.gz: 49d082032cc9ed4254730bb6a9b49aa157cb6d9eb16c6c04380dfc55a65e346fbf5e653a5f811e1836e3a750c897cc1b923e328f7b8a28fc7b312e2ce1d92bbd
data/CHANGELOG.md CHANGED
@@ -1,6 +1,12 @@
1
- ### 0.11.4 / 2025-05-25
1
+ ### 0.13.0 / 2026-11-16
2
2
 
3
- - Lock the `0.11.x` release series to use `websocket-driver` up to version `0.7`
3
+ - Add `allow_drafts` option to explicitly enable support for `draft75` and
4
+ `draft76` protocols; these are now disabled by default
5
+
6
+ ### 0.12.0 / 2025-05-25
7
+
8
+ - Represent binary messages as strings with `Encoding::BINARY` rather than as
9
+ arrays
4
10
 
5
11
  ### 0.11.3 / 2023-07-25
6
12
 
data/LICENSE.md CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2010-2025 James Coglan
1
+ Copyright 2010-2026 James Coglan
2
2
 
3
3
  Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4
4
  this file except in compliance with the License. You may obtain a copy of the
data/README.md CHANGED
@@ -194,6 +194,8 @@ is an optional hash containing any of these keys:
194
194
  The default value is `2^26 - 1`, or 1 byte short of 64 MiB.
195
195
  - `:ping` - an integer that sets how often the WebSocket should send ping
196
196
  frames, measured in seconds
197
+ - `:allow_drafts` - whether to enable support for long-outdated draft versions
198
+ of the WebSocket protocol, `false` by default
197
199
  - `:tls` - a hash containing key-value pairs for specifying TLS parameters.
198
200
  These are passed along to EventMachine and you can find
199
201
  [more details here](http://rubydoc.info/gems/eventmachine/EventMachine%2FConnection%3Astart_tls)
@@ -22,7 +22,10 @@ module Faye
22
22
  def initialize(options = {})
23
23
  @ready_state = CONNECTING
24
24
  super()
25
- ::WebSocket::Driver.validate_options(options, [:headers, :extensions, :max_length, :ping, :proxy, :tls])
25
+
26
+ options = ::WebSocket::Driver.validate_options(options, [
27
+ :headers, :extensions, :max_length, :allow_drafts, :ping, :proxy, :tls, :binary_data_format
28
+ ])
26
29
 
27
30
  @driver = yield
28
31
 
@@ -63,11 +66,20 @@ module Faye
63
66
 
64
67
  def send(message)
65
68
  return false if @ready_state > OPEN
69
+
66
70
  case message
67
- when Numeric then @driver.text(message.to_s)
68
- when String then @driver.text(message)
69
- when Array then @driver.binary(message)
70
- else false
71
+ when Numeric then
72
+ @driver.text(message.to_s)
73
+ when String then
74
+ if message.encoding == Encoding::BINARY
75
+ @driver.binary(message)
76
+ else
77
+ @driver.text(message)
78
+ end
79
+ when Array then
80
+ @driver.binary(message)
81
+ else
82
+ false
71
83
  end
72
84
  end
73
85
 
@@ -14,7 +14,13 @@ module Faye
14
14
 
15
15
  def initialize(url, protocols = nil, options = {})
16
16
  @url = url
17
- super(options) { ::WebSocket::Driver.client(self, :max_length => options[:max_length], :protocols => protocols) }
17
+ super(options) {
18
+ ::WebSocket::Driver.client(self,
19
+ :max_length => options[:max_length],
20
+ :protocols => protocols,
21
+ :binary_data_format => options[:binary_data_format]
22
+ )
23
+ }
18
24
 
19
25
  proxy = options.fetch(:proxy, {})
20
26
  @endpoint = URI.parse(proxy[:origin] || @url)
@@ -59,6 +59,10 @@ module Faye
59
59
  return false
60
60
  end
61
61
 
62
+ def self.validate_options(options, valid_keys)
63
+ ::WebSocket::Driver.validate_options(options, valid_keys)
64
+ end
65
+
62
66
  def self.websocket?(env)
63
67
  ::WebSocket::Driver.websocket?(env)
64
68
  end
@@ -72,7 +76,12 @@ module Faye
72
76
  @env = env
73
77
  @url = WebSocket.determine_url(@env)
74
78
 
75
- super(options) { ::WebSocket::Driver.rack(self, :max_length => options[:max_length], :protocols => protocols) }
79
+ super(options) do
80
+ ::WebSocket::Driver.rack(self,
81
+ :max_length => options[:max_length],
82
+ :protocols => protocols,
83
+ :allow_drafts => options[:allow_drafts])
84
+ end
76
85
  @driver_started = false
77
86
 
78
87
  @stream = Stream.new(self)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faye-websocket
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.4
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Coglan
@@ -29,20 +29,14 @@ dependencies:
29
29
  requirements:
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 0.5.1
33
- - - "<"
34
- - !ruby/object:Gem::Version
35
- version: 0.8.0
32
+ version: 0.9.0
36
33
  type: :runtime
37
34
  prerelease: false
38
35
  version_requirements: !ruby/object:Gem::Requirement
39
36
  requirements:
40
37
  - - ">="
41
38
  - !ruby/object:Gem::Version
42
- version: 0.5.1
43
- - - "<"
44
- - !ruby/object:Gem::Version
45
- version: 0.8.0
39
+ version: 0.9.0
46
40
  - !ruby/object:Gem::Dependency
47
41
  name: permessage_deflate
48
42
  requirement: !ruby/object:Gem::Requirement
@@ -95,16 +89,16 @@ dependencies:
95
89
  name: rack
96
90
  requirement: !ruby/object:Gem::Requirement
97
91
  requirements:
98
- - - ">="
92
+ - - "<"
99
93
  - !ruby/object:Gem::Version
100
- version: '0'
94
+ version: '3'
101
95
  type: :development
102
96
  prerelease: false
103
97
  version_requirements: !ruby/object:Gem::Requirement
104
98
  requirements:
105
- - - ">="
99
+ - - "<"
106
100
  - !ruby/object:Gem::Version
107
- version: '0'
101
+ version: '3'
108
102
  - !ruby/object:Gem::Dependency
109
103
  name: rspec
110
104
  requirement: !ruby/object:Gem::Requirement
@@ -220,7 +214,8 @@ files:
220
214
  homepage: https://github.com/faye/faye-websocket-ruby
221
215
  licenses:
222
216
  - Apache-2.0
223
- metadata: {}
217
+ metadata:
218
+ changelog_uri: https://github.com/faye/faye-websocket-ruby/blob/main/CHANGELOG.md
224
219
  rdoc_options:
225
220
  - "--main"
226
221
  - README.md
@@ -239,7 +234,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
239
234
  - !ruby/object:Gem::Version
240
235
  version: '0'
241
236
  requirements: []
242
- rubygems_version: 3.6.7
237
+ rubygems_version: 3.6.9
243
238
  specification_version: 4
244
239
  summary: Standards-compliant WebSocket server and client
245
240
  test_files: []