Skip to content

GOST relay — mihomo

mihomo can dial a GOST relay server as an outbound using GOST's relay protocol. The connection can be plaintext or wrapped in TLS, optionally with stream multiplexing, and authenticated with a username/password pair.

Outbound

Entry under proxies: with type: gost-relay. Embeds BasicOption (common outbound fields).

FieldTypeDefaultAllowed valuesDescription
namestring(required)<string>Unique proxy name.
serverstring(required)<host>GOST relay server host/IP.
portint(required)<port>GOST relay server port.
forwardboolfalsetrue | falseForward mode: send the relay request with an empty target address and let the server route to its own preconfigured upstream instead of the address mihomo requested.
udpboolfalsetrue | falseEnable UDP relaying.
tlsboolfalsetrue | falseWrap the relay connection in TLS.
muxboolfalsetrue | falseMultiplex multiple streams over one connection (smux).
snistring(server name)<SNI>TLS SNI when `tls` is on. Defaults to `server`.
usernamestring(unset)<string>Relay authentication username.
passwordstring(unset)<string>Relay authentication password.
skip-cert-verifyboolfalsetrue | falseDisable TLS verification (test only).
fingerprintstring(unset)<SHA256 hex>Pin the server's TLS certificate to this fingerprint.
certificatestring(unset)<PEM file path>Client certificate (mTLS).
private-keystring(unset)<key file path>Private key matching `certificate`.
client-fingerprintstring(global)chrome | firefox | safari | ios | edge | random | randomizeduTLS client-hello fingerprint to mimic.

Source: adapter/outbound/gost_relay.go:19-36 · pinned at v1.19.27 (5184081)

Examples

Outbound — plain relay with authentication:

yaml
proxies:
  - name: gost-srv
    type: gost-relay
    server: relay.example.com
    port: 8443
    username: <username>
    password: <password>
    udp: true

Outbound — relay over TLS with multiplexing:

yaml
proxies:
  - name: gost-tls
    type: gost-relay
    server: relay.example.com
    port: 443
    tls: true
    sni: relay.example.com
    mux: true
    username: <username>
    password: <password>
    udp: true

Notes

  • By default mihomo sends the requested destination to the relay server and the server connects there on its behalf. With forward: true the relay request carries an empty target address, so the server routes the connection to its own preconfigured upstream instead of the address mihomo asked for — useful when chaining to a relay that already has a fixed next hop.
  • mux wraps the (optionally TLS) connection in an smux session and opens a stream per dial, multiplexing several logical connections over one underlying socket.
  • tls enables TLS for the relay connection. sni overrides the handshake server name (defaulting to server); skip-cert-verify, fingerprint, certificate/private-key (mTLS), and client-fingerprint (uTLS) tune the TLS layer. These have no effect unless tls is on.
  • udp: true enables UDP relaying through the server.

Cross-core notes

  • GOST is a separate relay project with its own protocol. Neither Xray-core nor sing-box has a built-in GOST relay client, so this outbound is mihomo-specific — to reach a GOST endpoint from those cores you would front it with a protocol they both speak (e.g. a Shadowsocks or SOCKS hop).

Source: adapter/outbound/gost_relay.go:19-36 · v1.19.27 (5184081)

Core Tutorial by Argsment