package config import "flag" type Config struct { ListenAddr string OutputDir string CertPath string KeyPath string } func ParseFlags() Config { listenAddr := flag.String("listen", ":1199", "proxy listen address") outputDir := flag.String("out-dir", "./captures/images", "directory for captured image responses") certPath := flag.String("cert", "./cert.pem", "MITM CA certificate path (PEM)") keyPath := flag.String("key", "./key.pem", "MITM CA private key path (PEM)") flag.Parse() return Config{ ListenAddr: *listenAddr, OutputDir: *outputDir, CertPath: *certPath, KeyPath: *keyPath, } }