Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix http endpoint scheme #549

Merged
merged 2 commits into from
Dec 10, 2024
Merged

Conversation

jonstacks
Copy link
Collaborator

What

This fixes the agent endpoint getting created as a HTTPS endpoint even though the scheme in the url is HTTP.

How

  • Add some extra logging
  • If the URL scheme is http, add the scheme opt so that the endpoint is created as a http endpoint instead of https. We may want to consider fixing this in the ngrok SDK going forward.

Breaking Changes

No

@jonstacks jonstacks added the bug Something isn't working label Dec 10, 2024
@jonstacks jonstacks self-assigned this Dec 10, 2024
@jonstacks jonstacks requested a review from a team as a code owner December 10, 2024 17:29
@github-actions github-actions bot added the area/controller Issues dealing with the controller label Dec 10, 2024
@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to leave this comment in? If the URL was already parsed using the helper func, then it should already have a scheme, even if the user used one of the shorthand formats.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was meant to comment on the ngrok-go SDK not respecting the scheme in the URL that we give it to remind me to fix it upstream. Open to removing it or modifying it for clarity.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries, was just a little confused

@jonstacks jonstacks added this pull request to the merge queue Dec 10, 2024
Merged via the queue into ngrok:main with commit a86e1d6 Dec 10, 2024
8 checks passed
@jonstacks jonstacks deleted the fix-http-endpoint-scheme branch December 10, 2024 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/controller Issues dealing with the controller bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants