Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge package:http2 #1318

Merged
merged 179 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from 177 commits
Commits
Show all changes
179 commits
Select commit Hold shift + click to select a range
d3953a8
Initial commit
mkustermann Mar 19, 2015
b92d81c
Initialize repository from oss-template & add codereview.settings file
mkustermann Mar 19, 2015
e35a643
HPack: Add huffman encoding/decoding support
mkustermann Mar 27, 2015
3a14442
HPack: Add static/dynamic index tables & usage of huffman codec
mkustermann Apr 7, 2015
7932afc
Framing: Add classes for all frames of a HTTP/2 connection.
mkustermann Apr 8, 2015
2d5b148
Framing: Add FrameWriter, FrameReader
mkustermann Apr 9, 2015
32b274c
Connection: Add readConnectionSequence() function
mkustermann Apr 9, 2015
fdaeafb
Framing: Add a FrameDefragmenter class
mkustermann Apr 10, 2015
cf437b9
Handler: Settings handler, tests for FrameReader of settings frames
mkustermann Apr 13, 2015
4896b6b
Handler: Implement PingHandler
mkustermann Apr 13, 2015
4d976b3
Introduce ensureNotTerminated{Sync,Async} functions, simplify setting…
mkustermann Apr 15, 2015
bd59f26
Connection: Add basic Connection class for handling ping/settings frames
mkustermann May 20, 2015
fe48507
Implement connection/stream level queues and window handlers for flow…
mkustermann May 22, 2015
b3e3db5
Add StreamsHandler, TransportStream and HTTP/2 stream state management
mkustermann May 27, 2015
56f9a79
Make server pushes work in client/server
mkustermann May 28, 2015
0d29b02
Add proof-of-concept HTTP/2 client and test google/twitter
mkustermann May 28, 2015
3eaf51e
Ignore stream priority frames for "idle" streams, do not enforce stre…
mkustermann Jun 29, 2015
0d75c0b
Added temporarily a package:http2/debug.dart library
mkustermann Jun 29, 2015
a778364
Add experimental HTTP/2 server for testing server-push with browsers.
mkustermann Jul 6, 2015
337f00a
Move highest stream id handling to StreamHandler, update working test
mkustermann Aug 5, 2015
34109c8
Restructure error handling slightly for processing of incoming frames
mkustermann Aug 5, 2015
0640533
Add error details to goaway frames, add first error test
mkustermann Aug 5, 2015
9f03242
Add ClosableMixin and use it in stream/connection in/out queues
mkustermann Aug 12, 2015
a3fd95a
Implement (first version) of graceful shutdown.
mkustermann Aug 13, 2015
b2df920
Extract some byte related functions into separate libarary: Use it in…
mkustermann Aug 13, 2015
6e678e4
Implement server-side termination of a stream
mkustermann Aug 21, 2015
b54e62e
Add client tests for client behavior
mkustermann Aug 21, 2015
e38c84f
Require sdk with boringssl support, remove sqlite db
mkustermann Aug 27, 2015
6b96abe
Use package:test, make client website tests work with gzip responses.
mkustermann Aug 31, 2015
9a6ddc6
Add ClientConnection.isOpen to signal if new requests can be made, ad…
mkustermann Aug 31, 2015
a448d85
Add more tests which test client behavior if server is misbehaving
mkustermann Sep 1, 2015
74bcb72
Introduce {Client,Server}Settings, enforce max concurrent streams set…
mkustermann Sep 1, 2015
c01501e
Forward SETTINGS_HEADER_TABLE_SIZE to hpack encoder
mkustermann Sep 1, 2015
fa37e8a
Wait for stream in/out queues to be closed before removing a stream f…
mkustermann Sep 2, 2015
01a3051
Make ClientConnection.isOpen and ServerTransportStream.canPush now if…
mkustermann Sep 2, 2015
809f9fb
Implement termination of streams after receiving a Goaway frame
mkustermann Sep 3, 2015
2eeed52
Add first transport test for asserting flowcontrol window decrease pa…
mkustermann Sep 3, 2015
117fa66
Add support for SETTINGS_INITIAL_WINDOW_SIZE setting changes.
mkustermann Sep 3, 2015
91ae35a
Handling of malicious peer which sends more data than flow control wi…
mkustermann Sep 4, 2015
a20504b
Implement handling of RstStreamFrame
mkustermann Sep 7, 2015
14d38cd
Move package:http2/{client,debug}.dart to package:http2/testing
mkustermann Sep 7, 2015
94d181d
Add documentation to the transport library, and move testing/ to src…
mkustermann Sep 7, 2015
de70f6b
ignoring .pub and .packages
kevmoo Sep 8, 2015
d3c35ac
link to more info
sethladd Sep 18, 2015
82b4f9a
Update example server after moving debug.dart
mkustermann Dec 11, 2015
9539f10
Add a MultiProtocolHttpServer which calls two different callbacks dep…
mkustermann Jan 11, 2016
ab902b0
Try to send EndStreamFlag together with headers (if possible)
mkustermann Jan 11, 2016
dbb7a43
Fix performance issue when underlying socket is not writable
mkustermann Feb 2, 2016
34e2a87
Allow users of MultiProtocolHttpServer to pass http.ServerSettings
mkustermann Feb 2, 2016
b3ab39b
Include errorCode in exception message.
mkustermann Mar 17, 2017
aaffcc4
Add .test_config and disable some tests on MacOS
mkustermann Mar 30, 2017
fdf60e2
Make end2end client tests more resilient to different html responses
mkustermann Mar 31, 2017
bd870f0
Allow closing the stream with the last frame. (dart-lang/http2#8)
jakobr-google Jun 22, 2017
fea8d60
Fix hints and lints. (dart-lang/http2#10)
jakobr-google Jun 29, 2017
17b3e72
Add hook for receiving stream RST error. (dart-lang/http2#9)
jakobr-google Jul 3, 2017
5099c35
Update change log and pubspec for release 0.1.2. (dart-lang/http2#11)
jakobr-google Jul 5, 2017
6dacf78
Window updates. (dart-lang/http2#12)
jakobr-google Jul 12, 2017
76bfd60
Release 0.1.3
jakobr-google Jul 18, 2017
4d86ea3
Add onActiveStateChanged callback to Connection. (dart-lang/http2#13)
jakobr-google Oct 2, 2017
63bc30e
Add travis support
kevmoo Oct 3, 2017
ced4807
dartfmt
kevmoo Oct 3, 2017
cb6b083
Remove use of new Function syntax for onActiveStateChanged. (dart-lan…
jakobr-google Oct 5, 2017
f449c7a
Strong mode fixes and other cleanup (dart-lang/http2#17)
kevmoo Oct 20, 2017
edb0f11
Remove use of dart:mirrors. (dart-lang/http2#18)
jakobr-google Nov 3, 2017
5e1e377
Lower mockito dependency to 2.0.0 (dart-lang/http2#19)
jakobr-google Nov 3, 2017
0531af6
Use StreamView instead of StreamMethodsMixin. (dart-lang/http2#20)
jakobr-google Dec 23, 2017
ae5c184
Release 0.1.7 (dart-lang/http2#21)
jakobr-google Jan 11, 2018
3a3fac5
Changes for landing https://github.com/dart-lang/sdk/issues/32161 (da…
MichaelRFairhurst Feb 20, 2018
487dbfa
Remaining changes to make tests pass under a 2.0 VM (dart-lang/http2#23)
mkustermann Mar 21, 2018
9b6764b
Add upper-bound on SDK constraint (dart-lang/http2#24)
mkustermann Mar 21, 2018
41032c5
Stop running Travis on Stable
kevmoo Mar 23, 2018
2783a9f
Switch all uppercase constants to new lowercase (dart-lang/http2#28)
srawlins Jun 1, 2018
1e630d5
Fix `ClientTransportConnection.isOpen` to return `false` if we have e…
mkustermann Jul 16, 2018
a0f2afd
Adds a GoawayMessage and makes sure we enqueue these instead of racin…
Aug 8, 2018
4ee6e18
Fix examples to work with dart2
jonasfj Aug 9, 2018
4508f29
Fix manual test for dart2
jonasfj Aug 9, 2018
c02eba3
Fix dartanalyzer issues in tests
jonasfj Aug 9, 2018
e1f1ff4
Merge pull request dart-lang/http2#32 from cskau-g/master
cskau-g Aug 10, 2018
4891ed0
Discard messages incoming after stream cancellation (dart-lang/http2#35)
a14n Nov 1, 2018
bd9da86
Version bump
sigurdm Nov 1, 2018
ab71647
Update CHANGELOG.md
sigurdm Nov 1, 2018
e57609a
Merge pull request dart-lang/http2#36 from dart-lang/sigurdm-patch-1
sigurdm Nov 1, 2018
bae76f5
Update AUTHORS (dart-lang/http2#37)
a14n Nov 26, 2018
ba85327
Fill in README.md. (dart-lang/http2#38)
sigurdm Dec 13, 2018
fd23e63
Add http2.dart and prepare for 1.0 (dart-lang/http2#39)
sigurdm Dec 14, 2018
07831ac
Update analysis_options.yaml
kevmoo Apr 12, 2019
287d4d0
Remove codereview.settings
kevmoo May 29, 2019
1bf896c
Fix API link
kevmoo May 29, 2019
6b68d64
Travis: test on oldest support Dart SDK
kevmoo May 29, 2019
12b65a2
Update .gitignore
kevmoo May 29, 2019
da54c64
nghttp2.org seems to be down
kevmoo May 29, 2019
55c069b
Remove duplicate lint, enable/fix prefer_single_quotes
kevmoo May 29, 2019
5c2a392
Prepare for upcoming change to HttpRequest and HttpClientResponse (da…
tvolkert Jun 25, 2019
57db3b2
Fix lints (dart-lang/http2#45)
kevmoo Jul 10, 2019
ffe665e
Remove unused private fields (dart-lang/http2#55)
natebosch Feb 20, 2020
9d5ceec
Enable and fix lint annotate_overrides (dart-lang/http2#56)
natebosch Feb 20, 2020
7659f96
Run dartfmt --fix (dart-lang/http2#54)
natebosch Feb 20, 2020
99df062
Enable and fix lint always_declare_return_types (dart-lang/http2#57)
natebosch Feb 20, 2020
211f0d9
Enable lint unawaited_futures (dart-lang/http2#58)
natebosch Feb 20, 2020
a78e218
Enable and fix lint omit_local_variable_types (dart-lang/http2#61)
natebosch Feb 20, 2020
cb048bb
Enable and fix lint prefer_is_empty (dart-lang/http2#60)
natebosch Feb 20, 2020
a4fcc1b
Remove unnecessary library statements (dart-lang/http2#59)
natebosch Feb 20, 2020
a05c8c1
Enable and fix use_function_type_syntax_for_parameters (dart-lang/htt…
natebosch Feb 20, 2020
c5da8a2
Enable package:pedantic lints (dart-lang/http2#63)
natebosch Feb 20, 2020
0bbda86
Use hasLength in tests (dart-lang/http2#64)
natebosch Feb 20, 2020
930bb5d
Disable implicit casts (dart-lang/http2#65)
natebosch Feb 20, 2020
89f9566
Use isA type matcher in tests (dart-lang/http2#66)
natebosch Feb 20, 2020
123dfd6
Use whenComplete over then with catchError (dart-lang/http2#67)
natebosch Feb 26, 2020
f1b3a6f
Remove author from pubspec
kevmoo Mar 15, 2020
04eabdd
Update README.md
wertklop Jun 22, 2020
e51be1b
Merge pull request dart-lang/http2#68 from wertklop/patch-1
mit-mit Sep 10, 2020
11c21c9
Add TransportConnection.onInitialPeerSettingsReceived (dart-lang/http…
mraleph Sep 23, 2020
093edd9
Start working on 1.0.2 (dart-lang/http2#71)
mraleph Sep 23, 2020
8f01b40
Fix deprecated API usage, bump minimum SDK (dart-lang/http2#72)
kevmoo Nov 24, 2020
c7863df
Migrate http2 to null safety (dart-lang/http2#78)
iinozemtsev Jan 20, 2021
903662e
Migrate to GitHub Actions (dart-lang/http2#81)
athomas Jan 27, 2021
2a595e9
Fix tests and some lints (dart-lang/http2#83)
kevmoo Feb 8, 2021
2a4578a
Prepare for v2, null-safe stable (dart-lang/http2#84)
kevmoo Feb 11, 2021
82adfc5
Update LICENSE
franklinyow Apr 2, 2021
62083be
Merge pull request dart-lang/http2#86 from dart-lang/franklinyow-patch-1
franklinyow Apr 2, 2021
2cc6e44
fix directive sorting (dart-lang/http2#87)
kevmoo May 3, 2021
e760986
Add dependabot
kevmoo Jun 5, 2021
4c0149b
Bump dart-lang/setup-dart from 0.3 to 1 (dart-lang/http2#88)
dependabot[bot] Jun 5, 2021
59abd34
Ditch dart:io import. (dart-lang/http2#89)
xclud Jun 23, 2021
95c4c63
Migrate to null-safety stable. (dart-lang/http2#92)
xclud Jun 23, 2021
4e05de6
Drop unused code (dart-lang/http2#94)
natebosch Jun 23, 2021
4448b23
Fix MockGenerator for TerminatableMixin.ensureNotTerminatedSync (dart…
srawlins Sep 15, 2021
ca7e20f
Drop unneeded import (dart-lang/http2#101)
kevmoo Sep 26, 2021
dd16c9d
Bump actions/checkout from 2 to 3 (dart-lang/http2#103)
dependabot[bot] Mar 2, 2022
578336a
switch to package:lints
devoncarew May 12, 2022
aae9f9b
test against 2.15
devoncarew May 12, 2022
3376ba0
Merge pull request dart-lang/http2#104 from dart-lang/use_package_lints
devoncarew May 13, 2022
d7b7ff8
Simplify waiting during close (dart-lang/http2#105)
natebosch May 13, 2022
79527a7
Fix hint related to importing BytesBuilder from dart:io (dart-lang/ht…
kevmoo Sep 19, 2022
b65c98e
update CI config; use lints/recommended (dart-lang/http2#108)
devoncarew Oct 5, 2022
df93757
Fix lint updates (dart-lang/http2#110)
kevmoo Nov 14, 2022
5074ad3
Bump actions/checkout from 3.1.0 to 3.2.0 (dart-lang/http2#111)
dependabot[bot] Dec 15, 2022
35da177
Bump actions/checkout from 3.2.0 to 3.3.0 (dart-lang/http2#112)
dependabot[bot] Jan 9, 2023
14d2c8b
Migrate from no-implicit-casts to strict-casts (dart-lang/http2#113)
srawlins Jan 9, 2023
38079c5
dependabot: monthly is plenty (dart-lang/http2#115)
kevmoo Jan 17, 2023
68da2dc
Bump dart-lang/setup-dart from 1.3 to 1.4 (dart-lang/http2#114)
dependabot[bot] Jan 30, 2023
bb78614
Bump actions/checkout from 3.3.0 to 3.5.0 (dart-lang/http2#118)
dependabot[bot] Apr 3, 2023
16ee983
Bump dart-lang/setup-dart from 1.4.0 to 1.5.0 (dart-lang/http2#117)
dependabot[bot] Apr 3, 2023
0b75978
Bump actions/checkout from 3.5.0 to 3.5.2 (dart-lang/http2#119)
dependabot[bot] May 1, 2023
2f44da1
blast_repo fixes (dart-lang/http2#120)
devoncarew May 17, 2023
b3c49b4
Send WINDOW_UPDATE frames for data on closed streams. (dart-lang/http…
mosuem Jun 6, 2023
fa77acf
Switch to mixins for Dart 3 (dart-lang/http2#123)
mosuem Jun 7, 2023
2c81ef6
Transform header names to lowercase (dart-lang/http2#125)
mosuem Jun 7, 2023
2b8cfcc
Bump version (dart-lang/http2#126)
natebosch Jun 7, 2023
f4482d9
Expose pings to connection (dart-lang/http2#127)
mosuem Jun 19, 2023
10b3eed
Prepare release to 2.2.0 (dart-lang/http2#128)
mosuem Jun 21, 2023
996a3d8
Bump actions/checkout from 3.5.2 to 3.5.3 (dart-lang/http2#129)
dependabot[bot] Jul 1, 2023
182b198
Update README.md (dart-lang/http2#131)
mosuem Aug 4, 2023
7810c64
Bump actions/checkout from 3.5.3 to 3.6.0 (dart-lang/http2#132)
dependabot[bot] Sep 1, 2023
0b91b76
Bump dart-lang/setup-dart from 1.5.0 to 1.5.1 (dart-lang/http2#133)
dependabot[bot] Oct 1, 2023
1dd3c12
Bump actions/checkout from 3.6.0 to 4.1.0 (dart-lang/http2#134)
dependabot[bot] Oct 2, 2023
ededaf7
Bump actions/checkout from 4.1.0 to 4.1.1 (dart-lang/http2#136)
dependabot[bot] Nov 1, 2023
b9f1d5d
Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (dart-lang/http2#135)
dependabot[bot] Nov 1, 2023
1f2c62b
Add auto publish workflow (dart-lang/http2#138)
mosuem Jan 8, 2024
dc24e03
Switch to callbacks from streams for ping handling (dart-lang/http2#137)
mosuem Jan 8, 2024
816f6c5
blast repo changes: auto-publish, github-actions, no-response (dart-l…
kevmoo Jan 25, 2024
d5bde24
Add PR health workflow (dart-lang/http2#141)
mosuem Jan 26, 2024
95338a1
Require Dart 3.2, update lints (dart-lang/http2#140)
kevmoo Jan 31, 2024
478d2fe
Bump dart-lang/setup-dart from 1.6.1 to 1.6.2 (dart-lang/http2#142)
dependabot[bot] Feb 1, 2024
1535d43
Bump actions/checkout from 4.1.1 to 4.1.2 (dart-lang/http2#143)
dependabot[bot] Apr 1, 2024
2e8d0ad
Bump actions/checkout from 4.1.2 to 4.1.4 (dart-lang/http2#146)
dependabot[bot] May 1, 2024
2a96bfc
Bump dart-lang/setup-dart from 1.6.2 to 1.6.4 (dart-lang/http2#145)
dependabot[bot] May 1, 2024
672a7d4
blast_repo fixes (dart-lang/http2#147)
devoncarew May 7, 2024
49a77f3
Bump actions/checkout from 4.1.4 to 4.1.5 in the github-actions group…
dependabot[bot] May 7, 2024
3463b2f
Add `topics` to package "http2" `pubspec.yaml` (dart-lang/http2#150)
szakarias May 30, 2024
d932a29
Bump actions/checkout from 4.1.5 to 4.1.6 in the github-actions group…
dependabot[bot] Jun 1, 2024
db395cb
Bump the github-actions group with 2 updates (dart-lang/http2#154)
dependabot[bot] Jul 1, 2024
4d1b69a
Bump actions/checkout from 4.1.7 to 4.2.0 in the github-actions group…
dependabot[bot] Oct 1, 2024
cc39071
Merge package:http2 into the http monorepo
mosuem Oct 17, 2024
ca023aa
Add issue template and other fixes
mosuem Oct 17, 2024
ced6bc8
Moving fixes
mosuem Oct 17, 2024
a6eba74
Rename wf
mosuem Oct 17, 2024
e7db29d
Fixes as per review
mosuem Oct 18, 2024
e6f2fb5
Merge branch 'master' into merge-http2-package
mosuem Oct 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/http2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
name: "package:http2"
about: "Create a bug or file a feature request against package:http2."
labels: "package:http2"
---
6 changes: 5 additions & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
- changed-files:
- any-glob-to-any-file: 'pkgs/http/**'

'package:http2':
- changed-files:
- any-glob-to-any-file: 'pkgs/http2/**'

'package:http_client_conformance_tests':
- changed-files:
- any-glob-to-any-file: 'pkgs/http_client_conformance_tests/**'
- any-glob-to-any-file: 'pkgs/http_client_conformance_tests/**'
67 changes: 67 additions & 0 deletions .github/workflows/http2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: package:http2

on:
push:
branches:
- main
mosuem marked this conversation as resolved.
Show resolved Hide resolved
- master
paths:
- '.github/workflows/http2.yaml'
- 'pkgs/http2/**'
pull_request:
paths:
- '.github/workflows/http2.yaml'
- 'pkgs/http2/**'
schedule:
- cron: "0 0 * * 0"

env:
PUB_ENVIRONMENT: bot.github

mosuem marked this conversation as resolved.
Show resolved Hide resolved
jobs:
# Check code formatting and static analysis on a single OS (linux)
# against Dart dev.
analyze:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sdk: [dev]
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
with:
sdk: ${{ matrix.sdk }}
- id: install
name: Install dependencies
run: dart pub get
- name: Check formatting
run: dart format --output=none --set-exit-if-changed .
if: always() && steps.install.outcome == 'success'
- name: Analyze code
run: dart analyze --fatal-infos
if: always() && steps.install.outcome == 'success'

# Run tests on a matrix consisting of two dimensions:
# 1. OS: ubuntu-latest, (macos-latest, windows-latest)
# 2. release channel: dev
test:
needs: analyze
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# Add macos-latest and/or windows-latest if relevant for this package.
os: [ubuntu-latest]
sdk: [3.2, dev]
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
with:
sdk: ${{ matrix.sdk }}
- id: install
name: Install dependencies
run: dart pub get
- name: Run VM tests
run: dart test --platform vm
if: always() && steps.install.outcome == 'success'
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and the browser.
| [cupertino_http](pkgs/cupertino_http/) | A macOS/iOS Flutter plugin that provides access to the [Foundation URL Loading System](https://developer.apple.com/documentation/foundation/url_loading_system). | [![pub package](https://img.shields.io/pub/v/cupertino_http.svg)](https://pub.dev/packages/cupertino_http) |
| [flutter_http_example](pkgs/flutter_http_example/) | An Flutter app that demonstrates how to configure and use `package:http`. | — |
| [http](pkgs/http/) | A composable, multi-platform, Future-based API for HTTP requests. | [![pub package](https://img.shields.io/pub/v/http.svg)](https://pub.dev/packages/http) |
| [http2](pkgs/http2/) | A HTTP/2 implementation in Dart. | [![pub package](https://img.shields.io/pub/v/http2.svg)](https://pub.dev/packages/http2) |
| [http_client_conformance_tests](pkgs/http_client_conformance_tests/) | A library that tests whether implementations of package:http's `Client` class behave as expected. | |
| [http_profile](pkgs/http_profile/) | A library used by HTTP client authors to integrate with the DevTools Network View. | [![pub package](https://img.shields.io/pub/v/http_profile.svg)](https://pub.dev/packages/http_profile) |
| [ok_http](pkgs/ok_http/) | An Android Flutter plugin that provides access to the [OkHttp](https://square.github.io/okhttp/) HTTP client and the OkHttp [WebSocket](https://square.github.io/okhttp/5.x/okhttp/okhttp3/-web-socket/index.html) API. | [![pub package](https://img.shields.io/pub/v/ok_http.svg)](https://pub.dev/packages/ok_http) |
Expand Down
4 changes: 4 additions & 0 deletions pkgs/http2/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Don’t commit the following directories created by pub.
.dart_tool
.packages
pubspec.lock
5 changes: 5 additions & 0 deletions pkgs/http2/.test_config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"test_package": {
"platforms" : ["vm"]
}
}
8 changes: 8 additions & 0 deletions pkgs/http2/AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Below is a list of people and organizations that have contributed
# to the project. Names should be added to the list like so:
#
# Name/Organization <email address>

Google Inc. <*@google.com>

Alexandre Ardhuin <[email protected]>
115 changes: 115 additions & 0 deletions pkgs/http2/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
## 2.3.1

- Require Dart 3.2
- Add topics to `pubspec.yaml`
- Move to `dart-lang/http` monorepo.

## 2.3.0

- Only send updates on frames and pings being received when there are listeners, as to not fill up memory.

## 2.2.0

- Transform headers to lowercase.
- Expose pings to connection to enable the KEEPALIVE feature for gRPC.

## 2.1.0

- Require Dart `3.0.0`
- Require Dart `2.17.0`.
- Send `WINDOW_UPDATE` frames for the connection to account for data being sent on closed streams until the `RST_STREAM` has been processed.

## 2.0.1

- Simplify the implementation of `MultiProtocolHttpServer.close`.
- Require Dart `2.15.0`.

## 2.0.0

* Migrate to null safety.

## 1.0.1

* Add `TransportConnection.onInitialPeerSettingsReceived` which fires when
initial SETTINGS frame is received from the peer.

## 1.0.0

* Graduate package to 1.0.
* `package:http2/http2.dart` now reexports `package:http2/transport.dart`.

## 0.1.9

* Discard messages incoming after stream cancellation.

## 0.1.8+2

* On connection termination, try to dispatch existing messages, thereby avoiding
terminating existing streams.

* Fix `ClientTransportConnection.isOpen` to return `false` if we have exhausted
the number of max-concurrent-streams.

## 0.1.8+1

* Switch all uppercase constants from `dart:convert` to lowercase.

## 0.1.8

* More changes required for making tests pass under Dart 2.0 runtime.
* Modify sdk constraint to require '>=2.0.0-dev.40.0'.

## 0.1.7

* Fixes for Dart 2.0.

## 0.1.6

* Strong mode fixes and other cleanup.

## 0.1.5

* Removed use of new `Function` syntax, since it isn't fully supported in Dart
1.24.

## 0.1.4

* Added an `onActiveStateChanged` callback to `Connection`, which is invoked when
the connection changes state from idle to active or from active to idle. This
can be used to implement an idle connection timeout.

## 0.1.3

* Fixed a bug where a closed window would not open correctly due to an increase
in initial window size.

## 0.1.2

* The endStream bit is now set on the requested frame, instead of on an empty
data frame following it.
* Added an `onTerminated` hook that is called when a TransportStream receives
a RST_STREAM frame.

## 0.1.1+2

* Add errorCode to exception toString message.

## 0.1.1+1

* Fixing a performance issue in case the underlying socket is not writeable
* Allow clients of MultiProtocolHttpServer to supply [http.ServerSettings]
* Allow the draft version 'h2-14' in the ALPN protocol negogiation.

## 0.1.1

* Adding support for MultiProtocolHttpServer in the
`package:http2/multiprotocol_server.dart` library

## 0.1.0

* First version of a HTTP/2 transport implementation in the
`package:http2/transport.dart` library

## 0.0.1

- Initial version
27 changes: 27 additions & 0 deletions pkgs/http2/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Copyright 2015, the Dart project authors.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Google LLC nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
55 changes: 55 additions & 0 deletions pkgs/http2/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
[![pub package](https://img.shields.io/pub/v/http2.svg)](https://pub.dev/packages/http2)
[![package publisher](https://img.shields.io/pub/publisher/http2.svg)](https://pub.dev/packages/http2/publisher)

This library provides an http/2 interface on top of a bidirectional stream of bytes.

## Usage

Here is a minimal example of connecting to a http/2 capable server, requesting
a resource and iterating over the response.

```dart
import 'dart:convert';
import 'dart:io';

import 'package:http2/http2.dart';

Future<void> main() async {
final uri = Uri.parse('https://www.google.com/');

final transport = ClientTransportConnection.viaSocket(
await SecureSocket.connect(
uri.host,
uri.port,
supportedProtocols: ['h2'],
),
);

final stream = transport.makeRequest(
[
Header.ascii(':method', 'GET'),
Header.ascii(':path', uri.path),
Header.ascii(':scheme', uri.scheme),
Header.ascii(':authority', uri.host),
],
endStream: true,
);

await for (var message in stream.incomingMessages) {
if (message is HeadersStreamMessage) {
for (var header in message.headers) {
final name = utf8.decode(header.name);
final value = utf8.decode(header.value);
print('Header: $name: $value');
}
} else if (message is DataStreamMessage) {
// Use [message.bytes] (but respect 'content-encoding' header)
}
}
await transport.finish();
}
```

An example with better error handling is available [here][example].

See the [API docs][api] for more details.
9 changes: 9 additions & 0 deletions pkgs/http2/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# https://dart.dev/tools/analysis#the-analysis-options-file
include: package:dart_flutter_team_lints/analysis_options.yaml

analyzer:
language:
strict-casts: true
errors:
# Disabled as there are several dozen violations.
constant_identifier_names: ignore
2 changes: 2 additions & 0 deletions pkgs/http2/dart_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
tags:
flaky: # Tests that should be run as a separate job on Travis
67 changes: 67 additions & 0 deletions pkgs/http2/example/display_headers.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'dart:async';
import 'dart:convert';
import 'dart:io';

import 'package:http2/transport.dart';

void main(List<String> args) async {
if (args.length != 1) {
print('Usage: dart display_headers.dart <HTTPS_URI>');
exit(1);
}

var uriArg = args[0];

if (!uriArg.startsWith('https://')) {
print('URI must start with https://');
exit(1);
}

var uri = Uri.parse(uriArg);

var socket = await connect(uri);

// The default client settings will disable server pushes. We
// therefore do not need to deal with [stream.peerPushes].
var transport = ClientTransportConnection.viaSocket(socket);

var headers = [
Header.ascii(':method', 'GET'),
Header.ascii(':path', uri.path),
Header.ascii(':scheme', uri.scheme),
Header.ascii(':authority', uri.host),
];

var stream = transport.makeRequest(headers, endStream: true);
await for (var message in stream.incomingMessages) {
if (message is HeadersStreamMessage) {
for (var header in message.headers) {
var name = utf8.decode(header.name);
var value = utf8.decode(header.value);
print('$name: $value');
}
} else if (message is DataStreamMessage) {
// Use [message.bytes] (but respect 'content-encoding' header)
}
}
await transport.finish();
}

Future<Socket> connect(Uri uri) async {
var useSSL = uri.scheme == 'https';
if (useSSL) {
var secureSocket = await SecureSocket.connect(uri.host, uri.port,
supportedProtocols: ['h2']);
if (secureSocket.selectedProtocol != 'h2') {
throw Exception('Failed to negogiate http/2 via alpn. Maybe server '
"doesn't support http/2.");
}
return secureSocket;
} else {
return await Socket.connect(uri.host, uri.port);
}
}
Loading
Loading