Skip to content

Commit

Permalink
Fix http endpoint scheme (#549)
Browse files Browse the repository at this point in the history
* chore(agent-endpoints): Add log for adding endpoint to session

* fix(agent-endpoints): http url should have a http scheme
  • Loading branch information
jonstacks authored Dec 10, 2024
1 parent 1716710 commit a86e1d6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/tunneldriver/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,12 @@ func (td *TunnelDriver) CreateAgentEndpoint(ctx context.Context, name string, sp
upstreamProto = string(*spec.Upstream.Protocol)
}
opts = append(opts, config.WithAppProtocol(upstreamProto))

// TODO: This should probably be inferred from the scheme in the URL
if ingressURL.Scheme == "http" {
opts = append(opts, config.WithScheme(config.SchemeHTTP))
}

tunnelConfig = config.HTTPEndpoint(opts...)
case "tls":
opts := []config.TLSEndpointOption{}
Expand All @@ -469,6 +475,7 @@ func (td *TunnelDriver) CreateAgentEndpoint(ctx context.Context, name string, sp
return fmt.Errorf("unsupported protocol for spec.url: %s", ingressURL.Scheme)
}

log.V(1).Info("Adding agent endpoint to ngrok session")
tun, err = session.Listen(ctx, tunnelConfig)
if err != nil {
return err
Expand Down

0 comments on commit a86e1d6

Please sign in to comment.