Skip to main content

Overview

This template provides a production‑ready Gost instance as a Monk runnable. You can:
  • Run it directly to get a managed tunnel/proxy server with sensible defaults
  • Inherit it in your own runnable to seamlessly add secure tunneling and forwarding to your stack
Gost (GO Simple Tunnel) is a simple security tunnel written in Golang. It supports multiple protocols (SOCKS5, HTTP/HTTPS, SS, SSR, SNI, TLS, KCP, Quic) and can work as a local/remote port forwarder, SOCKS/HTTP proxy, and more.

What this template manages

  • Gost container (ginuerzh/gost image, configurable tag)
  • Network service on configured port (default 8080 or 1080)
  • Persistent volumes for configuration
  • Optional authentication and encryption
  • Support for proxy chaining and multiple protocols

Quick start (run directly)

  1. Load templates
  1. Run Gost with defaults
  1. Customize credentials (recommended via inheritance)
Running directly uses the defaults defined in this template’s variables. Secrets added with monk secrets add will not affect this runnable unless you inherit it and reference those secrets.
  • Preferred: inherit and replace variables with secret("...") as shown below.
  • Alternative: fork/clone and edit the variables in gost/gost.yaml, then monk load MANIFEST and run.
Once started, Gost will listen on configured ports for proxy connections. Connect to localhost:8080 (or the runnable hostname inside Monk networks) using the configured protocol and credentials.

Configuration

Key variables you can customize in this template:
Configuration is persisted under ${monk-volume-path}/gost on the host. Custom Gost config files are mounted from ${monk-volume-path}/gost/config:/etc/gost. Inherit the Gost runnable in your application for secure tunneling. Example:
Then set the secrets once and run your app group:

Ports and connectivity

  • Service: gost on TCP port as configured (default 8080 for HTTP, 1080 for SOCKS5)
  • From other runnables in the same process group, use connection-hostname("\<connection-name>") to resolve the proxy host.

Persistence and configuration

  • Config path: ${monk-volume-path}/gost/config:/etc/gost
  • You can drop additional JSON config files into the config path to configure Gost.

Features

  • Multiple Protocols: SOCKS4/5, HTTP/HTTPS, SS, SSR, SNI, TLS, KCP, Quic
  • Port Forwarding: Local and remote port forwarding
  • Proxy Chain: Chain multiple proxies together
  • Authentication: Username/password auth
  • Encryption: TLS/SSL, Shadowsocks encryption
  • Load Balancing: Round-robin, random, least-connections
  • Traffic Routing: Rule-based routing
  • UDP Support: UDP over TCP tunneling

Proxy Modes

HTTP Proxy:
SOCKS5 Proxy:
Port Forwarding:
Reverse Proxy:
Shadowsocks:

Configuration File

Example JSON config (config.json):

Proxy Chaining

Chain multiple proxies for enhanced security or routing:
Request flow: Client → Gost → proxy1 → proxy2 → Destination

Client Configuration

Configure clients to use Gost: Browser (SOCKS5):
  • Proxy: localhost
  • Port: 1080
  • SOCKS v5
curl:
SSH through proxy:

Use cases

Gost excels at:
  • Secure HTTP/SOCKS proxy for applications
  • Port forwarding and tunneling
  • Bypassing network restrictions
  • Secure remote access
  • Load balancing across multiple proxies
  • Traffic routing and redirection
  • Development and testing proxies
  • High-availability proxy cluster: see other templates in this repository for clustered setups.
  • Combine with monitoring tools for observability.

Troubleshooting

  • Test proxy connection:
  • Check logs:
  • Enable debug mode in config for verbose logging.
  • For connection issues:
    • Verify firewall allows the proxy port
    • Check authentication credentials match
    • Test without proxy chain first
    • Ensure the container is running and listening
  • For performance issues, try different protocols (KCP for UDP, Quic for modern encryption).
  • Monitor bandwidth usage for proxy traffic to detect issues.