protocol-websocket 0.20.0 → 0.20.2

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: c0f42ab3d5253103ee0a3bc0b3b6ad1ba09c34cd05aa0ae8abcad14cf41889f5
4
- data.tar.gz: e543425bcc0219da7de6d8bf25c55cb27e2065ab3848090a0464558d929c1e79
3
+ metadata.gz: 359985418f2c1304957337e8d10ca42c7dec2225fa60e5db0e030e40ccdfbc30
4
+ data.tar.gz: fc29187e933f95505987ff87616c61877809fe3a0a94600b782d4d1728edef87
5
5
  SHA512:
6
- metadata.gz: c4f5c67e456e61dceab5407edc739e6c14c165f9d9e123459c64d307c4573f8db2d8ac441d13e009bdbfba34a2d5342db314a03d97635816be6a1031b156f401
7
- data.tar.gz: 268a562e395ae6bfbe2460881af7fe81a549ee43f1a95e2039250a8d50d15b217a2d1a251ca56e59e5b33866f1ecfc16b3b8efb861f4d15a449e07f8df1ddfe9
6
+ metadata.gz: ef23fec7204ea0b9d965c3972b94fa39e615b5581470703f16564e5031d9819acd720618027274fd900b77864bf662c8adb44e895ce74b505c95c4cb3a7393ed
7
+ data.tar.gz: 5fb3eefc7a49e405fa7c8cd729812cf79095e8b8addf8af27a8aa35b4d3f759901de6c41a7233aceb2a76df43166dba43440e54d5bda5b765225480b21fd4057
checksums.yaml.gz.sig CHANGED
@@ -1,3 +1,2 @@
1
- /!�ZYf|g��2ڊ��!��G2\8j���G����?��2��e�nA!E'ι
2
- WL�H ��`���H5ڀ��A6f;��Yr���-B��TZ^�:�*������Δ����A�5k�Q�:�R��e�dl/A!?Imn�����%��Qs4Ko��Df��֝�_/�nzfz�隐1����r��^�O #u��?��
3
- QK���JE�����n(i=w��:�\UT2L���'��i����d�[ =&��pf�B�q�[`��f�d�P�~VcA��]�
1
+ 7��� ͕�^ĥm��EQ���{��aV��x����︫gK��3��#�He���#&
2
+ Wz]y1Wv�d��Bɵ4ӽ{�"(vnzZ�b1KK��$_����ӻ Jm6���A���[YQ��hq >�c/�����97��$)g�����8v�EV���t�@�]#��liI ���<"��G������T u�3��O�i��W�B|��QÆ��MLv��i6l�Sd��]����#R��,7]ƲP]������[W/11Q;cFu��� Z����J�q�c��i1�\0 HygbwD6J���Kʊ4�J'r[��X�k�5
@@ -28,7 +28,7 @@ module Protocol
28
28
  # @attribute [Framer] The framer which is used for reading and writing frames.
29
29
  attr :framer
30
30
 
31
- # @attribte [String | Nil] The optional mask which is used when generating frames.
31
+ # @attribute [String | Boolean | Nil] The optional mask which is used when generating frames.
32
32
  attr :mask
33
33
 
34
34
  # @attribute [Integer] The allowed reserved bits.
@@ -1,9 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2019-2024, by Samuel Williams.
4
+ # Copyright, 2019-2025, by Samuel Williams.
5
5
  # Copyright, 2019, by Soumya.
6
6
  # Copyright, 2021, by Aurora Nockert.
7
+ # Copyright, 2025, by Taleh Zaliyev.
7
8
 
8
9
  require_relative "error"
9
10
 
@@ -23,7 +24,6 @@ module Protocol
23
24
  # @parameter mask [Boolean | String] An optional 4-byte string which is used to mask the payload.
24
25
  def initialize(finished = true, payload = nil, flags: 0, opcode: self.class::OPCODE, mask: false)
25
26
  if mask == true
26
- # Generate a unique mask for each frame:
27
27
  mask = SecureRandom.bytes(4)
28
28
  end
29
29
 
@@ -186,7 +186,7 @@ module Protocol
186
186
  end
187
187
 
188
188
  if length > maximum_frame_size
189
- raise ProtocolError, "Invalid payload length: #{@length} > #{maximum_frame_size}!"
189
+ raise ProtocolError, "Invalid payload length: #{length} > #{maximum_frame_size}!"
190
190
  end
191
191
 
192
192
  if mask
@@ -196,7 +196,7 @@ module Protocol
196
196
  payload = stream.read(length) or raise EOFError, "Could not read payload!"
197
197
 
198
198
  if payload.bytesize != length
199
- raise EOFError, "Incorrect payload length: #{@length} != #{payload.bytesize}!"
199
+ raise EOFError, "Incorrect payload length: #{length} != #{payload.bytesize}!"
200
200
  end
201
201
 
202
202
  return self.new(finished, payload, flags: flags, opcode: opcode, mask: mask)
@@ -29,11 +29,9 @@ module Protocol
29
29
 
30
30
  # Wraps an underlying {Async::IO::Stream} for reading and writing binary data into structured frames.
31
31
  class Framer
32
- def initialize(stream, frames = FRAMES, requires_masking: false)
32
+ def initialize(stream, frames = FRAMES)
33
33
  @stream = stream
34
34
  @frames = frames
35
-
36
- @requires_masking = requires_masking
37
35
  end
38
36
 
39
37
  # Close the underlying stream.
@@ -56,10 +54,6 @@ module Protocol
56
54
  klass = @frames[opcode] || Frame
57
55
  frame = klass.read(finished, flags, opcode, @stream, maximum_frame_size)
58
56
 
59
- if @requires_masking and !frame.mask
60
- raise ProtocolError, "Received unmasked frame but requires masking!"
61
- end
62
-
63
57
  return frame
64
58
  end
65
59
 
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Protocol
7
7
  module WebSocket
8
- VERSION = "0.20.0"
8
+ VERSION = "0.20.2"
9
9
  end
10
10
  end
data/license.md CHANGED
@@ -1,10 +1,11 @@
1
1
  # MIT License
2
2
 
3
- Copyright, 2019-2024, by Samuel Williams.
3
+ Copyright, 2019-2025, by Samuel Williams.
4
4
  Copyright, 2019, by Soumya.
5
5
  Copyright, 2019, by William T. Nelson.
6
6
  Copyright, 2020, by Olle Jonsson.
7
7
  Copyright, 2021, by Aurora Nockert.
8
+ Copyright, 2025, by Taleh Zaliyev.
8
9
 
9
10
  Permission is hereby granted, free of charge, to any person obtaining a copy
10
11
  of this software and associated documentation files (the "Software"), to deal
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protocol-websocket
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.20.0
4
+ version: 0.20.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  - Aurora Nockert
9
9
  - Soumya
10
10
  - Olle Jonsson
11
+ - Taleh Zaliyev
11
12
  - William T. Nelson
12
- autorequire:
13
13
  bindir: bin
14
14
  cert_chain:
15
15
  - |
@@ -41,7 +41,7 @@ cert_chain:
41
41
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
42
42
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
43
43
  -----END CERTIFICATE-----
44
- date: 2024-10-09 00:00:00.000000000 Z
44
+ date: 2025-04-12 00:00:00.000000000 Z
45
45
  dependencies:
46
46
  - !ruby/object:Gem::Dependency
47
47
  name: protocol-http
@@ -57,8 +57,6 @@ dependencies:
57
57
  - - "~>"
58
58
  - !ruby/object:Gem::Version
59
59
  version: '0.2'
60
- description:
61
- email:
62
60
  executables: []
63
61
  extensions: []
64
62
  extra_rdoc_files: []
@@ -92,7 +90,6 @@ licenses:
92
90
  metadata:
93
91
  documentation_uri: https://socketry.github.io/protocol-websocket/
94
92
  source_code_uri: https://github.com/socketry/protocol-websocket.git
95
- post_install_message:
96
93
  rdoc_options: []
97
94
  require_paths:
98
95
  - lib
@@ -107,8 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
107
104
  - !ruby/object:Gem::Version
108
105
  version: '0'
109
106
  requirements: []
110
- rubygems_version: 3.5.11
111
- signing_key:
107
+ rubygems_version: 3.6.2
112
108
  specification_version: 4
113
109
  summary: A low level implementation of the WebSocket protocol.
114
110
  test_files: []
metadata.gz.sig CHANGED
Binary file