Skip to content

Expose base.py as a public api.#28

Merged
ricea merged 1 commit intoGoogleChromeLabs:masterfrom
arenevier:base_refactoring
Apr 23, 2021
Merged

Expose base.py as a public api.#28
ricea merged 1 commit intoGoogleChromeLabs:masterfrom
arenevier:base_refactoring

Conversation

@arenevier
Copy link

Extract methods that can be used to implement Websocket over HTTP/2

The implementation of HTTP/2 handshake is quite similar to HTTP/1 with a
few differences:

  • headers are lower case in HTTP/2
  • not exactly the same headers must be validated
  • We don't handle Sec-WebSocket-Accept for HTTP/2
  • the response is different

So we can implement the handshake in a base class that will delegate
some operations to the parent class.

We make _base.py public by renaming it to base.py

@arenevier
Copy link
Author

two notes:

Copy link
Collaborator

@ricea ricea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm with tiny nits.

Extract methods that can be used to implement Websocket over HTTP/2

The implementation of HTTP/2 handshake is quite similar to HTTP/1 with a
few differences:
- headers are lower case in HTTP/2
- not exactly the same headers must be validated
- We don't handle Sec-WebSocket-Accept for HTTP/2
- the response is different

So we can implement the handshake in a base class that will delegate
some operations to the parent class.

We make _base.py public by renaming it to base.py
Copy link
Collaborator

@ricea ricea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ricea ricea merged commit 265579a into GoogleChromeLabs:master Apr 23, 2021
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request May 20, 2021
Automatic update from web-platform-tests
Squashed 'tools/third_party/pywebsocket3/' changes from 9db3d29db4..265579a969

265579a969 Expose base.py as a public api. (#28)
cdb83e3152 Add missing r to regular expression (#27)

git-subtree-dir: tools/third_party/pywebsocket3
git-subtree-split: 265579a969e1aec2a6457db7674a9e31fbb7d564

--
Merge commit '2a247ac52a4af9f82d50b2f96a43abe5c4629ed3' into HEAD

--
update ws_h2_handshake.py to recent pywebsocket

pywebsocket has been refactored to expose some utilities and base class
as part of its public API.
(see GoogleChromeLabs/pywebsocket3#28)

By updating to the newest pywebsocket3 version, we can make
ws_h2_handshake much simpler

--
Merge commit 'ec57f8af52fe5e1074ec2de6a5d0d88c4cab257a'

Closes web-platform-tests/wpt#28667.

--

wpt-commits: 2a247ac52a4af9f82d50b2f96a43abe5c4629ed3, c3c4473d852203e78c4927408aae0b42f95b7385, ec57f8af52fe5e1074ec2de6a5d0d88c4cab257a, 24fa46db564eb4491e9f84edd3d1a07316cc14c6
wpt-pr: 28667
jwidar pushed a commit to jwidar/LatencyZeroGithub that referenced this pull request Sep 16, 2025
Automatic update from web-platform-tests
Squashed 'tools/third_party/pywebsocket3/' changes from 9db3d29db4..265579a969

265579a969 Expose base.py as a public api. (#28)
cdb83e3152 Add missing r to regular expression (#27)

git-subtree-dir: tools/third_party/pywebsocket3
git-subtree-split: 265579a969e1aec2a6457db7674a9e31fbb7d564

--
Merge commit '2a247ac52a4af9f82d50b2f96a43abe5c4629ed3' into HEAD

--
update ws_h2_handshake.py to recent pywebsocket

pywebsocket has been refactored to expose some utilities and base class
as part of its public API.
(see GoogleChromeLabs/pywebsocket3#28)

By updating to the newest pywebsocket3 version, we can make
ws_h2_handshake much simpler

--
Merge commit 'ec57f8af52fe5e1074ec2de6a5d0d88c4cab257a'

Closes web-platform-tests/wpt#28667.

--

wpt-commits: 2a247ac52a4af9f82d50b2f96a43abe5c4629ed3, c3c4473d852203e78c4927408aae0b42f95b7385, ec57f8af52fe5e1074ec2de6a5d0d88c4cab257a, 24fa46db564eb4491e9f84edd3d1a07316cc14c6
wpt-pr: 28667
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants