Skip to content

Commit

Permalink
fix: tunnel setup
Browse files Browse the repository at this point in the history
  • Loading branch information
zepatrik committed Jun 26, 2024
1 parent 76816ef commit 97724e0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
./ory proxy https://ory-network-httpbin-ijakee5waq-ez.a.run.app --quiet --rewrite-host &
npm run test
env:
ORY_API_KEY: placeholder
ORY_PROJECT_SLUG: affectionate-archimedes-s9mkjq77k0
ORY_CONSOLE_URL: https://console.staging.ory.dev
ORY_ORYAPIS_URL: https://staging.oryapis.dev
Expand Down
11 changes: 8 additions & 3 deletions cmd/cloudx/proxy/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,14 @@ func runReverseProxy(ctx context.Context, h *client.CommandHelper, stdErr io.Wri
mw.UseFunc(sessionToJWTMiddleware(conf, writer, key, signer, oryURL)) // This must be the last method before the handler
}

upstream, err := url.ParseRequestURI(conf.upstream)
if err != nil {
return errors.Wrap(err, "unable to parse upstream URL")
var upstream *url.URL
if conf.upstream != "" {
upstream, err = url.ParseRequestURI(conf.upstream)
if err != nil {
return errors.Wrap(err, "unable to parse upstream URL")
}
} else {
upstream = oryURL
}

mw.UseHandler(proxy.New(
Expand Down

0 comments on commit 97724e0

Please sign in to comment.