websocket-driver 0.7.5-java → 0.7.7-java
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
- data/lib/websocket_mask.jar +0 -0
- metadata +17 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d5ffeea6159c872d68b58d9eed70a8ed87e43bd1e5903f7921757cacb05ef052
|
|
4
|
+
data.tar.gz: dcba2e45aaaad54eae0cc9963bef8f2e10c8d789879d5880279dc4db223b644a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 90870f5824fee414c6827a78a8590a67bc7d62c09aee40ba141a4041eb18d8e24ff960d0a06ca5d49001c20950bf7db759ce773ba3cb2e03036e9f1645e04703
|
|
7
|
+
data.tar.gz: 9cbc5fe58827d684b8c2ada9bc40953c4ff02a17d9d61ff48a2346e125413623cd6a122b0d90e28554f710a7345bc63197f594fc06b8ade20d25be8b1338c11c
|
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)
|
data/lib/websocket_mask.jar
CHANGED
|
Binary file
|
metadata
CHANGED
|
@@ -1,15 +1,29 @@
|
|
|
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: java
|
|
6
6
|
authors:
|
|
7
7
|
- James Coglan
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2025-01-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - ">="
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: '0'
|
|
19
|
+
name: base64
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - ">="
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '0'
|
|
13
27
|
- !ruby/object:Gem::Dependency
|
|
14
28
|
requirement: !ruby/object:Gem::Requirement
|
|
15
29
|
requirements:
|
|
@@ -135,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
135
149
|
- !ruby/object:Gem::Version
|
|
136
150
|
version: '0'
|
|
137
151
|
requirements: []
|
|
138
|
-
rubygems_version: 3.
|
|
152
|
+
rubygems_version: 3.3.26
|
|
139
153
|
signing_key:
|
|
140
154
|
specification_version: 4
|
|
141
155
|
summary: WebSocket protocol handler with pluggable I/O
|