Skip to content

Commit

Permalink
add proxy mode; resolves #987
Browse files Browse the repository at this point in the history
  • Loading branch information
qrkourier committed Feb 15, 2024
1 parent 5127214 commit e2370dd
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions ziti/cmd/create/create_config_router_edge.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@ const (
defaultPrivate = false
privateDescription = "Create a private router config"
tproxyTunMode = "tproxy"
proxyTunMode = "proxy"
hostTunMode = "host"
noneTunMode = "none"
optionTunnelerMode = "tunnelerMode"
defaultTunnelerMode = hostTunMode
tunnelerModeDescription = "Specify tunneler mode \"" + noneTunMode + "\", \"" + hostTunMode + "\", or \"" + tproxyTunMode + "\""
tunnelerModeDescription = "Specify tunneler mode \"" + noneTunMode + "\", \"" + hostTunMode + "\", \"" + tproxyTunMode + "\", or \"" + proxyTunMode + "\""
optionLanInterface = "lanInterface"
defaultLanInterface = ""
lanInterfaceDescription = "The interface on host of the router to insert iptables ingress filter rules"
Expand Down Expand Up @@ -110,8 +111,11 @@ func (options *CreateConfigRouterOptions) runEdgeRouter(data *ConfigTemplateValu
}

// Make sure the tunneler mode is valid
if options.TunnelerMode != hostTunMode && options.TunnelerMode != tproxyTunMode && options.TunnelerMode != noneTunMode {
return errors.New("Unknown tunneler mode [" + options.TunnelerMode + "] provided, should be \"" + noneTunMode + "\", \"" + hostTunMode + "\", or \"" + tproxyTunMode + "\"")
if options.TunnelerMode != hostTunMode &&
options.TunnelerMode != tproxyTunMode &&
options.TunnelerMode != proxyTunMode &&
options.TunnelerMode != noneTunMode {
return errors.New("Unknown tunneler mode [" + options.TunnelerMode + "] provided, should be \"" + noneTunMode + "\", \"" + hostTunMode + "\", \"" + proxyTunMode + "\", or \"" + tproxyTunMode + "\"")
}

tmpl, err := template.New("edge-router-config").Parse(routerConfigEdgeTemplate)
Expand Down

0 comments on commit e2370dd

Please sign in to comment.