@@ -89,7 +89,7 @@ func parseSingleOriginService(c *cli.Context, allowURLFromArgs bool) (OriginServ
8989 if c .IsSet ("hello-world" ) {
9090 return new (helloWorld ), nil
9191 }
92- if c .IsSet ("url" ) {
92+ if c .IsSet ("url" ) || c . IsSet ( config . BastionFlag ) {
9393 originURL , err := config .ValidateUrl (c , allowURLFromArgs )
9494 if err != nil {
9595 return nil , errors .Wrap (err , "Error validating origin URL" )
@@ -128,6 +128,7 @@ func (ing Ingress) CatchAll() *Rule {
128128func validate (ingress []config.UnvalidatedIngressRule , defaults OriginRequestConfig ) (Ingress , error ) {
129129 rules := make ([]Rule , len (ingress ))
130130 for i , r := range ingress {
131+ cfg := setConfig (defaults , r .OriginRequest )
131132 var service OriginService
132133
133134 if prefix := "unix:" ; strings .HasPrefix (r .Service , prefix ) {
@@ -143,6 +144,12 @@ func validate(ingress []config.UnvalidatedIngressRule, defaults OriginRequestCon
143144 service = & srv
144145 } else if r .Service == "hello_world" || r .Service == "hello-world" || r .Service == "helloworld" {
145146 service = new (helloWorld )
147+ } else if r .Service == "bastion" || cfg .BastionMode {
148+ // Bastion mode will always start a Websocket proxy server, which will
149+ // overwrite the localService.URL field when `start` is called. So,
150+ // leave the URL field empty for now.
151+ cfg .BastionMode = true
152+ service = new (localService )
146153 } else {
147154 // Validate URL services
148155 u , err := url .Parse (r .Service )
@@ -178,7 +185,7 @@ func validate(ingress []config.UnvalidatedIngressRule, defaults OriginRequestCon
178185 Hostname : r .Hostname ,
179186 Service : service ,
180187 Path : pathRegex ,
181- Config : setConfig ( defaults , r . OriginRequest ) ,
188+ Config : cfg ,
182189 }
183190 }
184191 return Ingress {Rules : rules , defaults : defaults }, nil
0 commit comments