# TCP Proxy for PostgreSQL
A simple TCP proxy that forwards PostgreSQL connections to different target databases (including SSH-tunneled connections) based on runtime target selection.
## Why
This tool is born out of my need to switch between different postgres connection (local and remove via an ssh connection). This proxy does the switching between the databases, so I don't have to go and update multiple service configs.
## Usage
```bash
tcproxy --help
A TCP proxy for PostgreSQL connections with SSH tunnel support
Usage: tcproxy [OPTIONS] [COMMAND]
Commands:
start Start the proxy server
init-config Generate a default configuration file
validate-config Validate configuration file
show-config Show current configuration
list-targets List available targets
health-check Check health status of targets
help Print this message or the help of the given subcommand(s)
Options:
-c, --config <CONFIG> Configuration file path [default: config.yaml]
-l, --log-level <LOG_LEVEL> Log level (trace, debug, info, warn, error) [default: info]
--json-logs Enable JSON logging format
-h, --help Print help
-V, --version Print version
```