Skip to main content

Overview

The CLI Proxy API server configuration controls how the proxy binds to network interfaces, handles TLS encryption, and manages logging behavior.

Network Settings

host
string
default:"(empty)"
Server host/interface to bind to. Default is empty ("") to bind all interfaces (IPv4 + IPv6).Common values:
  • "" - Bind to all interfaces (default)
  • "127.0.0.1" or "localhost" - Restrict access to local machine only
  • Specific IP address - Bind to a particular network interface
Binding to all interfaces ("") exposes the server to your network. Use "127.0.0.1" for local-only access.
port
integer
default:"8317"
Server port number for the API server.Example:

TLS Configuration

tls
object
TLS settings for HTTPS. When enabled, the server listens with the provided certificate and key.

TLS Example

Use Let’s Encrypt or similar services to obtain free TLS certificates for production deployments.

Logging Configuration

debug
boolean
default:"false"
Enable debug logging for detailed diagnostics.When enabled:
  • Verbose request/response logging
  • Detailed error traces
  • Performance metrics
Example:
Debug mode may expose sensitive information. Use only in development or troubleshooting.
logging-to-file
boolean
default:"false"
When true, write application logs to rotating files instead of stdout.Log location: ./logs/ directory in the working directoryExample:
logs-max-total-size-mb
integer
default:"0"
Maximum total size (MB) of log files under the logs directory. When exceeded, the oldest log files are deleted until within the limit.Values:
  • 0 - Unlimited (default)
  • Positive integer - Size limit in megabytes
Example:
error-logs-max-files
integer
default:"10"
Maximum number of error log files retained when request logging is disabled. When exceeded, the oldest error log files are deleted.Values:
  • 0 - Disable cleanup
  • Positive integer - Maximum number of files
Example:

Performance Settings

commercial-mode
boolean
default:"false"
When true, disable high-overhead HTTP middleware features to reduce per-request memory usage under high concurrency.Impact:
  • Reduced memory footprint
  • Disabled detailed request tracking
  • Optimized for high-throughput scenarios
Example:
Enable commercial mode for production deployments handling thousands of concurrent requests.
usage-statistics-enabled
boolean
default:"false"
When false, disable in-memory usage statistics aggregation.Example:

Debug Server (pprof)

pprof
object
Enable pprof HTTP debug server for profiling and diagnostics.

pprof Example

Access pprof endpoints:
  • http://127.0.0.1:8316/debug/pprof/ - Index
  • http://127.0.0.1:8316/debug/pprof/heap - Memory profiling
  • http://127.0.0.1:8316/debug/pprof/goroutine - Goroutine profiling

Complete Server Configuration Example

Best Practices

Development vs Production:
  • Development: Use host: "127.0.0.1", debug: true, logging-to-file: false
  • Production: Use host: "", debug: false, logging-to-file: true, commercial-mode: true
Security Considerations:
  • Always use TLS in production
  • Never expose pprof to public networks
  • Rotate log files to prevent disk exhaustion
  • Use host: "127.0.0.1" if proxy is only accessed locally