Your opinion will help to improve our service
Leave a feedback >Quality:
🐙 userver implements HTTP/HTTPS 1.1, HTTP 2.0 and WebSocket server in userver-core
library using components::Server component.
Interactive clients (e.g. web browser) might want to get at least first bytes of the HTTP response if the whole HTTP response is generated slowly. In this case the HTTP handler might want to use Streaming API and return HTTP response body as a byte stream rather than as a single-part blob.
To enable Streaming API in your handler:
1) define HandleStreamRequest() method:
2) Enable Streaming API in static config:
3) Write your handler code:
The HTTP server in userver supports versions 1.1
and 2.0
. The default version is 1.1
. You can enable version 2.0
in the static config such as:
components_manager:
components:
# ... other components
server:
listener:
port: 8080
task_processor: main-task-processor
connection:
http-version: '2' # enum `1.1` or `2`
http2-session:
max_concurrent_streams: 100
max_frame_size: 16384
initial_window_size: 65536
You can set some options specific to HTTP/2.0
in the http2-session
section. See docs for these options in components::Server