websocket-driver 0.7.5 → 0.7.7
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 +4 -4
- data/CHANGELOG.md +8 -0
- data/LICENSE.md +1 -1
- data/lib/websocket/driver/client.rb +1 -2
- data/lib/websocket/driver/hybi.rb +2 -0
- data/lib/websocket/driver/proxy.rb +1 -3
- data/lib/websocket/driver.rb +9 -0
- metadata +17 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f871879972966e5137b9e1d791df17db7e6186e35bbf326e156682c7cc092410
|
|
4
|
+
data.tar.gz: a96b99173f63da1fe2769af05e78a40a51137f7e48cac2ec01d88bb883724c0f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 41df0469a3e829b6a13ddbbacdd39f81d80f433a14248f0748dc8831848de7c5c4db65539fdc5905d91fdd7fd2bcfaae08048f1ee6652603e79ced492230bab6
|
|
7
|
+
data.tar.gz: 1920877851a371d6d5493c94bd413fff3ce7f918166506aaa0a3b1a6fcae3961e1da06c315d0fd1bfc94a6c2bd0798f77f6e42429b86ccd9e25c6ad8dcedfa80
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
### 0.7.7 / 2025-01-04
|
|
2
|
+
|
|
3
|
+
- Add `base64` gem to the dependencies to support Ruby 3.4
|
|
4
|
+
|
|
5
|
+
### 0.7.6 / 2023-07-25
|
|
6
|
+
|
|
7
|
+
- Fix handling of default ports in `Host` headers on Ruby 3.1+
|
|
8
|
+
|
|
1
9
|
### 0.7.5 / 2021-06-12
|
|
2
10
|
|
|
3
11
|
- Do not change the encoding of strings passed to `Driver#text`
|
data/LICENSE.md
CHANGED
|
@@ -23,11 +23,10 @@ module WebSocket
|
|
|
23
23
|
raise URIError, "#{ socket.url } is not a valid WebSocket URL"
|
|
24
24
|
end
|
|
25
25
|
|
|
26
|
-
host = uri.host + (uri.port ? ":#{ uri.port }" : '')
|
|
27
26
|
path = (uri.path == '') ? '/' : uri.path
|
|
28
27
|
@pathname = path + (uri.query ? '?' + uri.query : '')
|
|
29
28
|
|
|
30
|
-
@headers['Host'] =
|
|
29
|
+
@headers['Host'] = Driver.host_header(uri)
|
|
31
30
|
@headers['Upgrade'] = 'websocket'
|
|
32
31
|
@headers['Connection'] = 'Upgrade'
|
|
33
32
|
@headers['Sec-WebSocket-Key'] = @key
|
|
@@ -4,8 +4,6 @@ module WebSocket
|
|
|
4
4
|
class Proxy
|
|
5
5
|
include EventEmitter
|
|
6
6
|
|
|
7
|
-
PORTS = { 'ws' => 80, 'wss' => 443 }
|
|
8
|
-
|
|
9
7
|
attr_reader :status, :headers
|
|
10
8
|
|
|
11
9
|
def initialize(client, origin, options)
|
|
@@ -20,7 +18,7 @@ module WebSocket
|
|
|
20
18
|
@state = 0
|
|
21
19
|
|
|
22
20
|
@headers = Headers.new
|
|
23
|
-
@headers['Host'] =
|
|
21
|
+
@headers['Host'] = Driver.host_header(@origin)
|
|
24
22
|
@headers['Connection'] = 'keep-alive'
|
|
25
23
|
@headers['Proxy-Connection'] = 'keep-alive'
|
|
26
24
|
|
data/lib/websocket/driver.rb
CHANGED
|
@@ -42,6 +42,7 @@ module WebSocket
|
|
|
42
42
|
end
|
|
43
43
|
|
|
44
44
|
MAX_LENGTH = 0x3ffffff
|
|
45
|
+
PORTS = { 'ws' => 80, 'wss' => 443 }
|
|
45
46
|
STATES = [:connecting, :open, :closing, :closed]
|
|
46
47
|
|
|
47
48
|
ConnectEvent = Struct.new(nil)
|
|
@@ -209,6 +210,14 @@ module WebSocket
|
|
|
209
210
|
data.force_encoding(encoding)
|
|
210
211
|
end
|
|
211
212
|
|
|
213
|
+
def self.host_header(uri)
|
|
214
|
+
host = uri.host
|
|
215
|
+
if uri.port and uri.port != PORTS[uri.scheme]
|
|
216
|
+
host += ":#{uri.port}"
|
|
217
|
+
end
|
|
218
|
+
host
|
|
219
|
+
end
|
|
220
|
+
|
|
212
221
|
def self.validate_options(options, valid_keys)
|
|
213
222
|
options.keys.each do |key|
|
|
214
223
|
unless valid_keys.include?(key)
|
metadata
CHANGED
|
@@ -1,15 +1,28 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: websocket-driver
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.7.
|
|
4
|
+
version: 0.7.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- James Coglan
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 2025-01-04 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: base64
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - ">="
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: '0'
|
|
19
|
+
type: :runtime
|
|
20
|
+
prerelease: false
|
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
+
requirements:
|
|
23
|
+
- - ">="
|
|
24
|
+
- !ruby/object:Gem::Version
|
|
25
|
+
version: '0'
|
|
13
26
|
- !ruby/object:Gem::Dependency
|
|
14
27
|
name: websocket-extensions
|
|
15
28
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -80,7 +93,6 @@ dependencies:
|
|
|
80
93
|
- - ">="
|
|
81
94
|
- !ruby/object:Gem::Version
|
|
82
95
|
version: '0'
|
|
83
|
-
description:
|
|
84
96
|
email: jcoglan@gmail.com
|
|
85
97
|
executables: []
|
|
86
98
|
extensions:
|
|
@@ -116,7 +128,6 @@ homepage: https://github.com/faye/websocket-driver-ruby
|
|
|
116
128
|
licenses:
|
|
117
129
|
- Apache-2.0
|
|
118
130
|
metadata: {}
|
|
119
|
-
post_install_message:
|
|
120
131
|
rdoc_options:
|
|
121
132
|
- "--main"
|
|
122
133
|
- README.md
|
|
@@ -135,8 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
135
146
|
- !ruby/object:Gem::Version
|
|
136
147
|
version: '0'
|
|
137
148
|
requirements: []
|
|
138
|
-
rubygems_version: 3.
|
|
139
|
-
signing_key:
|
|
149
|
+
rubygems_version: 3.6.2
|
|
140
150
|
specification_version: 4
|
|
141
151
|
summary: WebSocket protocol handler with pluggable I/O
|
|
142
152
|
test_files: []
|