async-websocket 0.19.2 → 0.20.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/async/websocket/adapters/rack.rb +9 -16
- data/lib/async/websocket/connect_request.rb +2 -1
- data/lib/async/websocket/connect_response.rb +1 -1
- data/lib/async/websocket/response.rb +1 -1
- data/lib/async/websocket/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +16 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0a051f2295a5f0874fb78259a546cf65e99a7b507a781df04817d9472391506c
|
4
|
+
data.tar.gz: 7fdd299047a497220c5ef7640a287b6f52691982ff12175f8d93f9a258de814e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6fb7a9e49527d946cc762da5a45bb389c91debdc55598b959dd4543f1f31e5921d3fd3901d2b99d9d7d366b3cb7cb3efde014122cce4e6fb981a372a852a5db5
|
7
|
+
data.tar.gz: a6f33b3043a6453754f429ac494f4afb1e44f2e7bc6511ab3d42c65e55a3e59efcc5e8d99f807d68fe707a1f1b1084a2aaaade0393d3d7b6c7dad4396b866afd
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -21,6 +21,7 @@
|
|
21
21
|
# THE SOFTWARE.
|
22
22
|
|
23
23
|
require_relative 'http'
|
24
|
+
require 'protocol/rack/request'
|
24
25
|
|
25
26
|
module Async
|
26
27
|
module WebSocket
|
@@ -29,27 +30,19 @@ module Async
|
|
29
30
|
include ::Protocol::WebSocket::Headers
|
30
31
|
|
31
32
|
def self.websocket?(env)
|
32
|
-
|
33
|
+
HTTP.websocket?(
|
34
|
+
::Protocol::Rack::Request[env]
|
35
|
+
)
|
33
36
|
end
|
34
37
|
|
35
38
|
def self.open(env, **options, &block)
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
headers = response.headers
|
41
|
-
|
42
|
-
if protocol = response.protocol
|
43
|
-
headers = Protocol::HTTP::Headers::Merged.new(headers, [
|
44
|
-
['rack.protocol', protocol]
|
45
|
-
])
|
46
|
-
end
|
47
|
-
|
48
|
-
return [response.status, headers.to_h, response.body]
|
49
|
-
end
|
39
|
+
request = ::Protocol::Rack::Request[env]
|
40
|
+
|
41
|
+
if response = HTTP.open(request, **options, &block)
|
42
|
+
return Protocol::Rack::Adapter.make_response(env, response)
|
50
43
|
end
|
51
44
|
end
|
52
45
|
end
|
53
46
|
end
|
54
47
|
end
|
55
|
-
end
|
48
|
+
end
|
@@ -23,6 +23,7 @@
|
|
23
23
|
require 'protocol/http/request'
|
24
24
|
require 'protocol/http/headers'
|
25
25
|
require 'protocol/websocket/headers'
|
26
|
+
require 'protocol/http/body/readable'
|
26
27
|
|
27
28
|
module Async
|
28
29
|
module WebSocket
|
@@ -64,7 +65,7 @@ module Async
|
|
64
65
|
end
|
65
66
|
end
|
66
67
|
|
67
|
-
class Hijack <
|
68
|
+
class Hijack < Protocol::HTTP::Body::Readable
|
68
69
|
def initialize(request)
|
69
70
|
@request = request
|
70
71
|
@stream = nil
|
@@ -30,7 +30,7 @@ module Async
|
|
30
30
|
def self.for(request, headers = nil, **options, &body)
|
31
31
|
if request.version =~ /http\/1/i
|
32
32
|
return UpgradeResponse.new(request, headers, **options, &body)
|
33
|
-
elsif request.version =~ /
|
33
|
+
elsif request.version =~ /http\/2/i
|
34
34
|
return ConnectResponse.new(request, headers, **options, &body)
|
35
35
|
end
|
36
36
|
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: async-websocket
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.20.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -45,7 +45,7 @@ cert_chain:
|
|
45
45
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
46
46
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
47
47
|
-----END CERTIFICATE-----
|
48
|
-
date: 2022-08-
|
48
|
+
date: 2022-08-19 00:00:00.000000000 Z
|
49
49
|
dependencies:
|
50
50
|
- !ruby/object:Gem::Dependency
|
51
51
|
name: async-http
|
@@ -89,6 +89,20 @@ dependencies:
|
|
89
89
|
- - "~>"
|
90
90
|
- !ruby/object:Gem::Version
|
91
91
|
version: 0.7.0
|
92
|
+
- !ruby/object:Gem::Dependency
|
93
|
+
name: protocol-rack
|
94
|
+
requirement: !ruby/object:Gem::Requirement
|
95
|
+
requirements:
|
96
|
+
- - "~>"
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: 0.1.1
|
99
|
+
type: :runtime
|
100
|
+
prerelease: false
|
101
|
+
version_requirements: !ruby/object:Gem::Requirement
|
102
|
+
requirements:
|
103
|
+
- - "~>"
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: 0.1.1
|
92
106
|
- !ruby/object:Gem::Dependency
|
93
107
|
name: async-rspec
|
94
108
|
requirement: !ruby/object:Gem::Requirement
|
metadata.gz.sig
CHANGED
Binary file
|