Plain HTTP Tunnel¶
PHT is a data channel type in GOST.
The CONNECT method is not supported by all HTTP services. For more general use, GOST uses the more commonly used GET and POST methods in the HTTP protocol to implement data channels, including encrypted phts and plain text pht modes.
TLS Certificate Configuration
For TLS configuration, please refer to TLS configuration.
Without TLS¶
With TLS¶
PHT over LTS。
Custom Request Path¶
The PHT channel consists of three parts:
- Authorization - The client needs to obtain the server's authorization code before transferring data with the server. The request URI is set through the
authorizePathoption. The default value is/authorize. - Receive data - The client receives data from the server. The request URI is set by
pullPathoption. The default value is/pull. - Send data - The client sends data to the server. The request URI is set by
pushPathoption. The default value is/push.
Path Matching Verification
The connection can be successfully established only when the options set by the client and the server are the same.
Custom Request Headers¶
The header option allows setting custom HTTP request headers. When establishing a PHT channel between client and server, these custom headers are automatically added to authorize, push, and pull requests.
This feature can be used with header-based authentication systems (e.g., Cloudflare Access), enabling authentication by including tokens in requests.
Proxy¶
PHT tunnel can be used in combination with various proxy protocols.
HTTP Over PHT¶
SOCKS5 Over PHT¶
Relay Over PHT¶
Port Forwarding¶
PHT tunnel can also be used as port forwarding.
Server
is equivalent to
By using port forwarding of the PHT tunnel, a PHT data channel is added to the SOCKS5 proxy service on port 1080.
At this time, port 8443 is equivalent to: