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

feat: add app protocol #130

Merged
merged 5 commits into from
Jan 12, 2024
Merged

feat: add app protocol #130

merged 5 commits into from
Jan 12, 2024

Conversation

OfTheDelmer
Copy link
Contributor

Why

We'd like to be able specify http2 when building an http tunnel

How

Add app_protocol to the builder and plumb the forwards_proto into the session rpc.

Validation

Run an example with the http2 app protocol and confirm the correct forwardsProto was set to "http2" or "" .

Copy link
Collaborator

@jrobsonchase jrobsonchase left a comment

Choose a reason for hiding this comment

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

After looking over this, I'm less sure about the enum approach. We might want to make it a string all the way through and defer validation to our hosted services. That way we can add new protocols we support there and don't have to go and update the sdk for each one. If we took that approach, the only thing I'd do in the builder methods would be to .to_lowercase() it.

Ultimately up to product though. @salilsub thoughts?

ngrok/examples/axum.rs Outdated Show resolved Hide resolved
ngrok/src/config/common.rs Outdated Show resolved Hide resolved
ngrok/src/config/http.rs Outdated Show resolved Hide resolved
ngrok/src/config/http.rs Outdated Show resolved Hide resolved
ngrok/src/config/labeled.rs Outdated Show resolved Hide resolved
@jrobsonchase
Copy link
Collaborator

Current dependencies on/for this PR:

This stack of pull requests is managed by Graphite.

@salilsub
Copy link

I think as a general rule we should push more validation to our hosted services so we can adjust those rules over time. There will be exceptions, but I think @jrobsonchase is right on this one.

@OfTheDelmer OfTheDelmer marked this pull request as ready for review January 9, 2024 18:27
ngrok/src/config/http.rs Outdated Show resolved Hide resolved
@OfTheDelmer OfTheDelmer merged commit 40760c9 into main Jan 12, 2024
11 checks passed
@OfTheDelmer OfTheDelmer deleted the del/app_protocol branch January 12, 2024 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants