Implement tcp proxy with single forward
This commit is contained in:
@@ -17,6 +17,7 @@ const flagPort = "p"
|
||||
const flagRoutes = "r"
|
||||
const flagConf = "c"
|
||||
const flagCert = "crt"
|
||||
const flagTCP = "tcp"
|
||||
const flagKey = "key"
|
||||
const flagUser = "user"
|
||||
const flagPass = "pass"
|
||||
@@ -36,6 +37,7 @@ type fileConf struct {
|
||||
Port string `yaml:"p"`
|
||||
Routes []string `yaml:"r"`
|
||||
CertPath string `yaml:"crt"`
|
||||
TCPPath string `yaml:"tcp"`
|
||||
KeyPath string `yaml:"key"`
|
||||
Username string `yaml:"user"`
|
||||
Password string `yaml:"pass"`
|
||||
@@ -85,6 +87,9 @@ func fromFile() error {
|
||||
if err := conf.Set(nsConf, flagCert, packable.NewString(c.CertPath)); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := conf.Set(nsConf, flagTCP, packable.NewString(c.TCPPath)); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := conf.Set(nsConf, flagKey, packable.NewString(c.KeyPath)); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -115,6 +120,7 @@ func fromFlags() error {
|
||||
binds = append(binds, addFlag(flagConf, "", "configuration file path"))
|
||||
binds = append(binds, addFlag(flagRoutes, "", "comma-separated routes to map, each as from:scheme://to.tld:port"))
|
||||
binds = append(binds, addFlag(flagCert, "", "path to .crt"))
|
||||
binds = append(binds, addFlag(flagTCP, "", "tcp addr"))
|
||||
binds = append(binds, addFlag(flagKey, "", "path to .key"))
|
||||
binds = append(binds, addFlag(flagUser, "", "basic auth username"))
|
||||
binds = append(binds, addFlag(flagPass, "", "basic auth password"))
|
||||
|
||||
Reference in New Issue
Block a user