HTTP2¶
HTTP2 has two modes: proxy mode and tunnel mode.
TLS Certificate Configuration
For TLS configuration, please refer to TLS configuration。
Proxy Mode¶
In proxy mode, HTTP2 is used as the proxy protocol and the data channel layer of the HTTP2 proxy must be http2
.
Tunnel Mode¶
In tunnel mode, HTTP2 is used as the data channel, which is divided into encrypted (h2) and plain text (h2c).
Custom Request Path¶
The HTTP2 data channel uses CONNECT
method to establish a connection by default. You can customize the request path through path
option. In this case, the method GET
is used to establish a connection.
Path Matching Verification
The connection can be successfully established only when the path
option set by the client and the server are the same.
Server
Client
Custom Request Hostname¶
By default, the HTTP2 data channel client uses the node address (-F parameter or the address specified in nodes.addr) as the request hostname (HTTP Host
header). The request hostname can be customized through host
option.
Custom HTTP Request Headers¶
You can customize the request header information through header
option.
services:
- name: service-0
addr: :8080
handler:
type: http
chain: chain-0
listener:
type: tcp
chains:
- name: chain-0
hops:
- name: hop-0
nodes:
- name: node-0
addr: :8443
connector:
type: http
dialer:
type: h2
metadata:
header:
User-Agent: "gost/3.0"
foo: bar