Mercurial > hg > nginx
comparison src/http/v2/ngx_http_v2.h @ 9119:08ef02ad5c54
HTTP/2: "http2" directive.
The directive enables HTTP/2 in the current server. The previous way to
enable HTTP/2 via "listen ... http2" is now deprecated. The new approach
allows to share HTTP/2 and HTTP/0.9-1.1 on the same port.
For SSL connections, HTTP/2 is now selected by ALPN callback based on whether
the protocol is enabled in the virtual server chosen by SNI. This however only
works since OpenSSL 1.0.2h, where ALPN callback is invoked after SNI callback.
For older versions of OpenSSL, HTTP/2 is enabled based on the default virtual
server configuration.
For plain TCP connections, HTTP/2 is now auto-detected by HTTP/2 preface, if
HTTP/2 is enabled in the default virtual server. If preface is not matched,
HTTP/0.9-1.1 is assumed.
author | Roman Arutyunyan <arut@nginx.com> |
---|---|
date | Tue, 16 May 2023 16:30:08 +0400 |
parents | ce6d9cf0f567 |
children | 262c01782566 |
comparison
equal
deleted
inserted
replaced
9118:b4a57278bf24 | 9119:08ef02ad5c54 |
---|---|
59 typedef struct ngx_http_v2_out_frame_s ngx_http_v2_out_frame_t; | 59 typedef struct ngx_http_v2_out_frame_s ngx_http_v2_out_frame_t; |
60 | 60 |
61 | 61 |
62 typedef u_char *(*ngx_http_v2_handler_pt) (ngx_http_v2_connection_t *h2c, | 62 typedef u_char *(*ngx_http_v2_handler_pt) (ngx_http_v2_connection_t *h2c, |
63 u_char *pos, u_char *end); | 63 u_char *pos, u_char *end); |
64 | |
65 | |
66 typedef struct { | |
67 ngx_flag_t enable; | |
68 size_t pool_size; | |
69 ngx_uint_t concurrent_streams; | |
70 ngx_uint_t concurrent_pushes; | |
71 size_t preread_size; | |
72 ngx_uint_t streams_index_mask; | |
73 } ngx_http_v2_srv_conf_t; | |
64 | 74 |
65 | 75 |
66 typedef struct { | 76 typedef struct { |
67 ngx_str_t name; | 77 ngx_str_t name; |
68 ngx_str_t value; | 78 ngx_str_t value; |
406 #define NGX_HTTP_V2_LOCATION_INDEX 46 | 416 #define NGX_HTTP_V2_LOCATION_INDEX 46 |
407 #define NGX_HTTP_V2_SERVER_INDEX 54 | 417 #define NGX_HTTP_V2_SERVER_INDEX 54 |
408 #define NGX_HTTP_V2_USER_AGENT_INDEX 58 | 418 #define NGX_HTTP_V2_USER_AGENT_INDEX 58 |
409 #define NGX_HTTP_V2_VARY_INDEX 59 | 419 #define NGX_HTTP_V2_VARY_INDEX 59 |
410 | 420 |
421 #define NGX_HTTP_V2_PREFACE_START "PRI * HTTP/2.0\r\n" | |
422 #define NGX_HTTP_V2_PREFACE_END "\r\nSM\r\n\r\n" | |
423 #define NGX_HTTP_V2_PREFACE NGX_HTTP_V2_PREFACE_START \ | |
424 NGX_HTTP_V2_PREFACE_END | |
425 | |
411 | 426 |
412 u_char *ngx_http_v2_string_encode(u_char *dst, u_char *src, size_t len, | 427 u_char *ngx_http_v2_string_encode(u_char *dst, u_char *src, size_t len, |
413 u_char *tmp, ngx_uint_t lower); | 428 u_char *tmp, ngx_uint_t lower); |
414 | 429 |
415 | 430 |
431 extern ngx_module_t ngx_http_v2_module; | |
432 | |
433 | |
416 #endif /* _NGX_HTTP_V2_H_INCLUDED_ */ | 434 #endif /* _NGX_HTTP_V2_H_INCLUDED_ */ |