Comments (9)
Work on this has started...
from async-http-client.
I think we should consider plaintext HTTP/2 (h2c) negotiation to be a non-goal. The IETF is considering removing h2c entirely from the next revision of the HTTP/2 RFC as it's essentially non-implemented. Plaintext HTTP/2 is supported, but only in the form of "prior knowledge" negotiation.
I think we should be able to achieve the simpler goal with the current architecture. Is this viable?
Yes.
How many concurrent h/2 connections do we want to support to a host? Only one? What do we want to do with EventLoopPreferences?
Only one. The RFC strongly encourages that we do so:
Clients SHOULD NOT open more than one HTTP/2 connection to a given host and port pair, where the host is derived from a URI, a selected alternative service, or a configured proxy.
What shall happen if an HTTP/2 connection already has the maximum number of concurrent requests running? SETTINGS_MAX_CONCURRENT_STREAMS (Especially important for something like sending push notifications)
Queue until a stream becomes available. swift-nio-http2 already has this ability.
Do we want to rename the HTTP1ConnectionProvider to HTTPConnectionProvider and save in the ConnectionsState whether this provider supports connections over HTTP/1.1 or HTTP/2? We should know after the first successful TLS connection.
TBD. Something somewhere needs to know the difference at some point, but whether it's encoded in the type system or not is a decision that needs to be made when we have a more detailed design.
from async-http-client.
apart from the obvious use-case -- to connect to HTTP/2 web servers -- this library could/should then also be used for swift-nio-apns.
from async-http-client.
@artemredkin / @ianpartridge / @tanner0101 should we pull this into the 1.0.0
milestone? I think it would be important to verify that the API actually works for HTTP/2. I don't foresee any issues but it'd be good to validate.
Obviously mostly useful together with a connection pool but ... @Lukasa what do you think?
from async-http-client.
I think we can ship 1.0
without HTTP/2. Adding connection pooling and HTTP/2 sounds like a great set of 2.0 features and we can make any necessary API changes then.
from async-http-client.
I’m inclined to agree: it seems more important to enable users to start using the library than to throw HTTP/2 support into the client.
from async-http-client.
Same here
from async-http-client.
Hi,
I took some time and looked into this the last days... I haven't started programming or anything, but I think I should at least document the open questions/ideas I ran into:
I think we should go the lazy route (like most browsers except Safari) and first only support http/2 over TLS. The protocol negotiation should be fairly easy this way and we know before sending the first HTTP request, if we will talk HTTP1 or HTTP2 on this connection.
I think we should be able to achieve the simpler goal with the current architecture. Is this viable?
Further Questions
- How many concurrent h/2 connections do we want to support to a host? Only one? What do we want to do with
EventLoopPreference
s? - What shall happen if an HTTP/2 connection already has the maximum number of concurrent requests running?
SETTINGS_MAX_CONCURRENT_STREAMS
(Especially important for something like sending push notifications) - Do we want to rename the
HTTP1ConnectionProvider
toHTTPConnectionProvider
and save in theConnectionsState
whether this provider supports connections over HTTP/1.1 or HTTP/2? We should know after the first successful TLS connection.
If you have any other design thoughts in the back of your heads, I'd be happy to know them. 😉
from async-http-client.
Fixed by #473
from async-http-client.
Related Issues (20)
- Shutdown does not close HTTP2 connection
- Linker Error on using AsyncHTTPClient while using Vapor inside XCode Project HOT 2
- crashed: free(): corrupted unsorted chunks #2617 HOT 5
- Support for SSE (EventSource) HOT 3
- _
- Different results for the same request on mac OS and Linux HOT 1
- README.md async/await example does not compile HOT 1
- Crash: precondition failure in HTTPConnectionPool+HTTP2Connections.swift:209 HOT 2
- Remove swift-docc-plugin dependency
- Too low of a decompression ratio in `HTTPClient.shared` settings HOT 11
- `Connection refused` not throwing right away HOT 6
- Rename and clarify the `body.collect(upTo:)` API which gets used in an insecure way all the time HOT 1
- How to initiate a request using a socks5 proxy with authentication? HOT 3
- OOM if setting `concurrentHTTP1ConnectionsPerHostSoftLimit: .max`
- `HTTPClient.execute(...) async throws` API violates Structured Concurrency HOT 17
- Canceling a download `Task` doesn't actually cancel it? HOT 3
- 7% of the overall runtime spent in `SelectableEventLoop.debugDescription`
- > 8% overall wall time spent for simple HTTP request on NSURL initialisation & related things
- Undesired (as in older faster than newer) perf delta between older and newer APIs
- Proxy server implementation example needed HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from async-http-client.