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:
port: 8317

TLS Configuration

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

TLS Example

tls:
  enable: true
  cert: "/etc/ssl/certs/server.crt"
  key: "/etc/ssl/private/server.key"
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: true
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:
logging-to-file: true
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:
logs-max-total-size-mb: 1024  # 1GB limit
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:
error-logs-max-files: 20

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:
commercial-mode: true
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:
usage-statistics-enabled: true

Debug Server (pprof)

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

pprof Example

pprof:
  enable: true
  addr: "127.0.0.1:8316"
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

# Network Settings
host: ""  # Bind to all interfaces
port: 8317

# TLS Configuration
tls:
  enable: true
  cert: "/etc/ssl/certs/server.crt"
  key: "/etc/ssl/private/server.key"

# Logging
debug: false
logging-to-file: true
logs-max-total-size-mb: 2048  # 2GB limit
error-logs-max-files: 15

# Performance
commercial-mode: true
usage-statistics-enabled: true

# Debug Server
pprof:
  enable: false
  addr: "127.0.0.1:8316"

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

Build docs developers (and LLMs) love