async-websocket 0.29.0 → 0.30.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4289b4859913198c24ca663a119281dd61bb34549e6cfe3cc9b85fe27e31c6ab
4
- data.tar.gz: 651f3364c06bd402877b94a36f2d358ab3cc1167a0aa9dd2c44b3745be04cfe5
3
+ metadata.gz: 65d7e723e07e05a813e668c1e4a3dfb82213b1b76955d2e1c8d7f8bcd338de8a
4
+ data.tar.gz: cbfe2bc3be018398c2c5787052cf5e381a10c3d8695a324be386cb7aef20f0df
5
5
  SHA512:
6
- metadata.gz: ec78385e62fe64eae8e50e7f8cd70f7f1a317c3a9961d72ac0f33f1682d99fc6bb753ce91611bceaa9cb642edd978dcb6d59ca4dbea978c1b0d9804a934dddb6
7
- data.tar.gz: da98480c126237140e19e45983ce73cb47e949c29078a5d867f694e02eab180e7f707649a0a4f6ad8e6377ea6412faddca63822866e73027995695aaecb12a90
6
+ metadata.gz: 9973e91dc44e1a8e072acd3f9c7c8fb999d62f3c0fc9a4e0e4e45558453e3f780838ed30e7a7216094afe059a5eb9831b06e0a36b92ec5ff5126f94eec8b46c5
7
+ data.tar.gz: bde87b0d45786863bf68c4c6d463fbc102ab2e3a0fa12c7fff9f346f5594858065d72ae6ee3b2bcfeb9289c1432681fb62f2350abc65d52257b62658ab3186bc
checksums.yaml.gz.sig CHANGED
Binary file
@@ -1,13 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2021-2023, by Samuel Williams.
4
+ # Copyright, 2021-2024, by Samuel Williams.
5
5
  # Copyright, 2021, by Aurora Nockert.
6
6
 
7
- require_relative '../connection'
8
- require_relative '../response'
7
+ require_relative "../connection"
8
+ require_relative "../response"
9
9
 
10
- require 'protocol/websocket/extensions'
10
+ require "protocol/websocket/extensions"
11
11
 
12
12
  module Async
13
13
  module WebSocket
@@ -39,8 +39,9 @@ module Async
39
39
  connection = handler.call(framer, protocol, extensions)
40
40
 
41
41
  yield connection
42
-
43
- connection.close unless connection.closed?
42
+ ensure
43
+ connection&.close
44
+ stream.close
44
45
  end
45
46
 
46
47
  # Once we get to this point, we no longer need to hold on to the request:
@@ -1,11 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2019-2022, by Samuel Williams.
4
+ # Copyright, 2019-2024, by Samuel Williams.
5
5
 
6
- require_relative 'http'
7
- require 'protocol/rack/request'
8
- require 'protocol/rack/adapter'
6
+ require_relative "http"
7
+ require "protocol/rack/request"
8
+ require "protocol/rack/adapter"
9
9
 
10
10
  module Async
11
11
  module WebSocket
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2021-2023, by Samuel Williams.
4
+ # Copyright, 2021-2024, by Samuel Williams.
5
5
  # Copyright, 2023, by Emily Love Mills.
6
6
 
7
- require_relative 'rack'
7
+ require_relative "rack"
8
8
 
9
9
  module Async
10
10
  module WebSocket
@@ -6,16 +6,16 @@
6
6
  # Copyright, 2019, by Janko Marohnić.
7
7
  # Copyright, 2023, by Thomas Morgan.
8
8
 
9
- require_relative 'request'
10
- require_relative 'connection'
9
+ require_relative "request"
10
+ require_relative "connection"
11
11
 
12
- require 'protocol/websocket/headers'
13
- require 'protocol/websocket/extensions'
14
- require 'protocol/http/middleware'
12
+ require "protocol/websocket/headers"
13
+ require "protocol/websocket/extensions"
14
+ require "protocol/http/middleware"
15
15
 
16
- require 'async/http/client'
16
+ require "async/http/client"
17
17
 
18
- require 'delegate'
18
+ require "delegate"
19
19
 
20
20
  module Async
21
21
  module WebSocket
@@ -62,9 +62,10 @@ module Async
62
62
 
63
63
  begin
64
64
  yield connection
65
+
65
66
  ensure
66
- connection.close
67
- client.close
67
+ connection&.close
68
+ client&.close
68
69
  end
69
70
  end
70
71
  end
@@ -1,15 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2019-2023, by Samuel Williams.
4
+ # Copyright, 2019-2024, by Samuel Williams.
5
5
  # Copyright, 2023, by Thomas Morgan.
6
6
 
7
- require 'protocol/http/request'
8
- require 'protocol/http/headers'
9
- require 'protocol/websocket/headers'
10
- require 'protocol/http/body/readable'
7
+ require "protocol/http/request"
8
+ require "protocol/http/headers"
9
+ require "protocol/websocket/headers"
10
+ require "protocol/http/body/readable"
11
11
 
12
- require 'async/variable'
12
+ require "async/variable"
13
13
 
14
14
  module Async
15
15
  module WebSocket
@@ -75,7 +75,7 @@ module Async
75
75
  headers.add(SEC_WEBSOCKET_VERSION, String(version))
76
76
 
77
77
  if protocols.any?
78
- headers.add(SEC_WEBSOCKET_PROTOCOL, protocols.join(','))
78
+ headers.add(SEC_WEBSOCKET_PROTOCOL, protocols.join(","))
79
79
  end
80
80
 
81
81
  super(request.scheme, request.authority, ::Protocol::HTTP::Methods::CONNECT, request.path, nil, headers, body, PROTOCOL)
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2019-2023, by Samuel Williams.
4
+ # Copyright, 2019-2024, by Samuel Williams.
5
5
 
6
- require 'protocol/http/response'
7
- require 'async/http/body/hijack'
6
+ require "protocol/http/response"
7
+ require "async/http/body/hijack"
8
8
 
9
9
  module Async
10
10
  module WebSocket
@@ -1,13 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2018-2023, by Samuel Williams.
4
+ # Copyright, 2018-2024, by Samuel Williams.
5
5
  # Copyright, 2019, by Janko Marohnić.
6
6
 
7
- require 'protocol/websocket/connection'
8
- require 'protocol/websocket/headers'
7
+ require "protocol/websocket/connection"
8
+ require "protocol/websocket/headers"
9
9
 
10
- require 'json'
10
+ require "json"
11
11
 
12
12
  module Async
13
13
  module WebSocket
@@ -42,6 +42,10 @@ module Async
42
42
  end
43
43
 
44
44
  attr :protocol
45
+
46
+ def inspect
47
+ "#<#{self.class} state=#{@state}>"
48
+ end
45
49
  end
46
50
  end
47
51
  end
@@ -1,9 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2019-2023, by Samuel Williams.
4
+ # Copyright, 2019-2024, by Samuel Williams.
5
5
 
6
- require 'protocol/websocket/error'
6
+ require "protocol/websocket/error"
7
7
 
8
8
  module Async
9
9
  module WebSocket
@@ -1,11 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2019-2023, by Samuel Williams.
4
+ # Copyright, 2019-2024, by Samuel Williams.
5
5
 
6
- require_relative 'connect_request'
7
- require_relative 'upgrade_request'
8
- require_relative 'error'
6
+ require_relative "connect_request"
7
+ require_relative "upgrade_request"
8
+ require_relative "error"
9
9
 
10
10
  module Async
11
11
  module WebSocket
@@ -1,12 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2019-2023, by Samuel Williams.
4
+ # Copyright, 2019-2024, by Samuel Williams.
5
5
 
6
- require_relative 'upgrade_response'
7
- require_relative 'connect_response'
6
+ require_relative "upgrade_response"
7
+ require_relative "connect_response"
8
8
 
9
- require_relative 'error'
9
+ require_relative "error"
10
10
 
11
11
  module Async
12
12
  module WebSocket
@@ -4,10 +4,10 @@
4
4
  # Copyright, 2018-2024, by Samuel Williams.
5
5
  # Copyright, 2019, by Simon Crocker.
6
6
 
7
- require_relative 'connection'
8
- require_relative 'response'
7
+ require_relative "connection"
8
+ require_relative "response"
9
9
 
10
- require 'protocol/http/middleware'
10
+ require "protocol/http/middleware"
11
11
 
12
12
  module Async
13
13
  module WebSocket
@@ -5,15 +5,13 @@
5
5
  # Copyright, 2023, by Thomas Morgan.
6
6
  # Copyright, 2024, by Ryu Sato.
7
7
 
8
- require 'protocol/http/middleware'
9
- require 'protocol/http/request'
8
+ require "protocol/http/middleware"
9
+ require "protocol/http/request"
10
10
 
11
- require 'protocol/http/headers'
12
- require 'protocol/websocket/headers'
11
+ require "protocol/http/headers"
12
+ require "protocol/websocket/headers"
13
13
 
14
- require 'securerandom'
15
-
16
- require_relative 'error'
14
+ require_relative "error"
17
15
 
18
16
  module Async
19
17
  module WebSocket
@@ -65,7 +63,7 @@ module Async
65
63
  headers.add(SEC_WEBSOCKET_VERSION, String(version))
66
64
 
67
65
  if protocols.any?
68
- headers.add(SEC_WEBSOCKET_PROTOCOL, protocols.join(','))
66
+ headers.add(SEC_WEBSOCKET_PROTOCOL, protocols.join(","))
69
67
  end
70
68
 
71
69
  super(request.scheme, request.authority, ::Protocol::HTTP::Methods::GET, request.path, nil, headers, nil, PROTOCOL)
@@ -82,7 +80,7 @@ module Async
82
80
  end
83
81
  end
84
82
 
85
- verified = accept_digest && Array(response.protocol).map(&:downcase) == %w(websocket) && response.headers['connection']&.include?('upgrade')
83
+ verified = accept_digest && Array(response.protocol).map(&:downcase) == %w(websocket) && response.headers["connection"]&.include?("upgrade")
86
84
 
87
85
  return Wrapper.new(response, verified: verified)
88
86
  end
@@ -1,12 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2019-2023, by Samuel Williams.
4
+ # Copyright, 2019-2024, by Samuel Williams.
5
5
  # Copyright, 2023, by Thomas Morgan.
6
6
 
7
- require 'async/http/body/hijack'
8
- require 'protocol/http/response'
9
- require 'protocol/websocket/headers'
7
+ require "async/http/body/hijack"
8
+ require "protocol/http/response"
9
+ require "protocol/websocket/headers"
10
10
 
11
11
  module Async
12
12
  module WebSocket
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Async
7
7
  module WebSocket
8
- VERSION = "0.29.0"
8
+ VERSION = "0.30.0"
9
9
  end
10
10
  end
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2015-2023, by Samuel Williams.
4
+ # Copyright, 2015-2024, by Samuel Williams.
5
5
 
6
- require_relative 'websocket/version'
7
- require_relative 'websocket/server'
8
- require_relative 'websocket/client'
6
+ require_relative "websocket/version"
7
+ require_relative "websocket/server"
8
+ require_relative "websocket/client"
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.29.0
4
+ version: 0.30.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -49,7 +49,7 @@ cert_chain:
49
49
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
50
50
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
51
51
  -----END CERTIFICATE-----
52
- date: 2024-09-03 00:00:00.000000000 Z
52
+ date: 2024-09-11 00:00:00.000000000 Z
53
53
  dependencies:
54
54
  - !ruby/object:Gem::Dependency
55
55
  name: async-http
@@ -57,56 +57,56 @@ dependencies:
57
57
  requirements:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: '0.54'
60
+ version: '0.76'
61
61
  type: :runtime
62
62
  prerelease: false
63
63
  version_requirements: !ruby/object:Gem::Requirement
64
64
  requirements:
65
65
  - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: '0.54'
67
+ version: '0.76'
68
68
  - !ruby/object:Gem::Dependency
69
69
  name: protocol-http
70
70
  requirement: !ruby/object:Gem::Requirement
71
71
  requirements:
72
- - - ">="
72
+ - - "~>"
73
73
  - !ruby/object:Gem::Version
74
- version: 0.28.1
74
+ version: '0.34'
75
75
  type: :runtime
76
76
  prerelease: false
77
77
  version_requirements: !ruby/object:Gem::Requirement
78
78
  requirements:
79
- - - ">="
79
+ - - "~>"
80
80
  - !ruby/object:Gem::Version
81
- version: 0.28.1
81
+ version: '0.34'
82
82
  - !ruby/object:Gem::Dependency
83
83
  name: protocol-rack
84
84
  requirement: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - "~>"
87
87
  - !ruby/object:Gem::Version
88
- version: '0.5'
88
+ version: '0.7'
89
89
  type: :runtime
90
90
  prerelease: false
91
91
  version_requirements: !ruby/object:Gem::Requirement
92
92
  requirements:
93
93
  - - "~>"
94
94
  - !ruby/object:Gem::Version
95
- version: '0.5'
95
+ version: '0.7'
96
96
  - !ruby/object:Gem::Dependency
97
97
  name: protocol-websocket
98
98
  requirement: !ruby/object:Gem::Requirement
99
99
  requirements:
100
100
  - - "~>"
101
101
  - !ruby/object:Gem::Version
102
- version: '0.15'
102
+ version: '0.17'
103
103
  type: :runtime
104
104
  prerelease: false
105
105
  version_requirements: !ruby/object:Gem::Requirement
106
106
  requirements:
107
107
  - - "~>"
108
108
  - !ruby/object:Gem::Version
109
- version: '0.15'
109
+ version: '0.17'
110
110
  description:
111
111
  email:
112
112
  executables: []
metadata.gz.sig CHANGED
Binary file