Comments (3)
See also #10
from tower-web.
- request header read timeout: max time it can take for the client to send all headers
- idle timeout for keepalive sessions
These would need to go in hyper. I would check to see if it is already possible.
- request body timeout
- request reply timeout (if a client simply doesn't read the reply)
- max number of simultaneous requests per client (source ip address)
- max number of requests/sec per client
Implemented as a middleware. It can start in this repo and eventually be moved into tower-http.
- if there was a way to get the client's IP address
Can be discussed in #71
- there should be a way for a request handler to reset/restart the timeouts, e.g. to facilitate large bodies or large replies.
You will have to elaborate more on this one.
If you want to take a stab at any of these items, I can help with some pointers.
from tower-web.
there should be a way for a request handler to reset/restart the timeouts, e.g. to facilitate large bodies or large replies.
You will have to elaborate more on this one.
For example, when you set a request body timeout of 30 seconds, and after the timeout it turns out that 30 MB of body payload already has been received - in that case, yes, 30 seconds have passed, but progress is made, so you want to ignore this timeout and set a new one.
Either this, or 2 seperate types of timeout: absolute, with a hard limit (N minutes no matter what) and relative, one that fires if no progress is made (connection stalled) for a certain period of time.
If it is possible to implement this as middleware, even better, because that would allow more complicated strategies as well (say when max. number of clients is reached, close the oldest sessions that are idling in keepalive).
For completeness, a list of nginx's timeouts.
- client_body_timeout (60s) (relative)
- send_timeout (60s) (relative)
- client_header_timeout (60s) (absolute)
- keepalive_timeout (75s)
from tower-web.
Related Issues (20)
- `not yet implemented` panic when parsing Json body HOT 4
- Typos HOT 1
- Multiple response types with status and generics
- Unable to use #[derive(Response)] with #[prost(...)] HOT 2
- Nightly compat: avoid suffixes on tuple indexing
- Consider mentioning the future plans HOT 2
- warning: suffixes on a tuple index are invalid HOT 2
- Lifetime error in chained and_then calls HOT 3
- Using synchronous reqwest from a synchronous handler causes a panic HOT 1
- Allow to set custom status code and error details for extract::error::Error HOT 1
- Determine the future of tower-web HOT 10
- Attribute 'get' is unknown HOT 1
- Attribute 'get' is unknown
- Add "argument name MUST be 'body' when parsing JSON" to the crate description
- #[derive(Extract)] -> error[E0463]: can't find crate for `serde` HOT 3
- Compile issues with `cargo run --example hello_world`
- tower-web spends significant time copying data around
- [Proposal] Contribute to a benchmark
- What should I add to "Cargo.toml"?
- error: unused extern crate proc_macro when trying to run examples
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 tower-web.