Websocket¶
Websocket is a data channel type in GOST.
TLS Certificate Configuration
For TLS configuration, please refer to TLS configuration。
Websocket¶
Unencrypted Websocket data channel.
Websocket Secure¶
Websocket data channel based on TLS encryption.
Multiplexing¶
GOST extends Websocket with multiplexing feature (mws, mwss), multiplexing is based on the xtaci/smux library.
Options¶
Multiplexing Related Options¶
mux.version
(int, default=1)- SMUX protocol version.
mux.keepaliveDisabled
(bool, default=false)- Whether to disable keep-alive.
mux.keepaliveInterval
(duration, default=10s)- Heartbeat interval.
mux.keepaliveTimeout
(duration, default=30s)- Heartbeat timeout.
mux.maxFrameSize
(int, default=32768)- Maximum frame length.
mux.maxReceiveBuffer
(int, default=4194304)- Receive buffer size.
mux.maxStreamBuffer
(int, default=65536)- Steam Buffer Size.
Custom Request Path¶
The request path can be customized via path
option, the default value is /ws
.
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 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: wss
metadata:
header:
User-Agent: "gost/3.0"
foo: bar
Keep-Alive¶
The client can enable keep-alive through keepalive
option and set the interval for sending heartbeat packets through ttl
option.
Proxy¶
Websocket tunnel can be used in combination with various proxy protocols.
HTTP Over Websocket¶
SOCKS5 Over Websocket¶
Relay Over Websocket¶
Port Forwarding¶
Websocket tunnel can also be used as port forwarding.
Server
is equivalent to
By using port forwarding of the websocket tunnel, a websocket data channel is added to the SOCKS5 proxy service on port 1080.
At this time, port 8443 is equivalent to: