upd
This commit is contained in:
25
internal/config/config.go
Normal file
25
internal/config/config.go
Normal file
@@ -0,0 +1,25 @@
|
||||
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,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user