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

[Feature] Integrate ngrok support #366

Open
esskar opened this issue Jan 3, 2025 · 9 comments
Open

[Feature] Integrate ngrok support #366

esskar opened this issue Jan 3, 2025 · 9 comments
Labels
integration A new .NET Aspire integration

Comments

@esskar
Copy link
Contributor

esskar commented Jan 3, 2025

Description

The feature request is to integrate ngrok support into the CommunityToolkit.Aspire project.

Motivation

ngrok support would enhance the developer experience by enabling secure and public URLs for local applications, which is especially useful for testing and demo purposes. This feature would be a great addition to the toolkit, providing:

  • Simplified local testing of webhooks.
  • Easier sharing of local applications for feedback or collaboration.
  • Improved accessibility during development.

Proposed Solution

Integrate the CommunityToolkit.Aspire.Hosting.Ngrok library into the main CommunityToolkit.Aspire repository.

For more information see https://github.com/esskar/CommunityToolkit.Aspire/tree/main/src/CommunityToolkit.Aspire.Hosting.Ngrok

@davidfowl
Copy link

Very cool! Is there a programmatic way to get the ngrok url for a resource being proxied? That would make it possible to pass it to other resources

@esskar
Copy link
Contributor Author

esskar commented Jan 3, 2025

Could try the api to retrieve it - or is there an easy way to pipe the stdout of the container to the host.

@davidfowl
Copy link

Ngrok doesn't have an api?

@esskar
Copy link
Contributor Author

esskar commented Jan 4, 2025

Ngrok doesn't have an api?

Yes there is, and i found a way. when i am called for the ResourceReadyEvent subscription, i can query the ngrok api to retireve the endpoints. Is there a way to publish those endpoints at this stage? Adding to the builder is probably to late, isn't it?

@davidfowl
Copy link

  1. I’m not sure you want to want to make them endpoints (there’s a chicken an egg problem). You maybe want to expose an api like endpoint like api. Typically the patten is exposing a builder API is a promise like object (it gets resolved in the future). This is going deeper than what’s currently documented for building hosting integrations but it’s available. Let me know if you still want to attempt to implement it.

The other question is, what happens to this resource in publish mode?

@esskar
Copy link
Contributor Author

esskar commented Jan 4, 2025

The other question is, what happens to this resource in publish mode?

I currently have it excluded from the manifest, as I saw it for development purposes only. But as i read more on ngrok, it could make sense to publish it.

Any suggestions here?

@esskar esskar mentioned this issue Jan 4, 2025
10 tasks
@aaronpowell aaronpowell added the integration A new .NET Aspire integration label Jan 9, 2025
@aaronpowell
Copy link
Member

What would the role of ngrok in production be?

I've merged the integration PR, it'll be in a preview on NuGet soon (takes a for manual steps). In the meantime, can you get it on docs - https://github.com/dotnet/docs-aspire/issues/new?template=05-community-toolkit-docs-request.yml

@esskar
Copy link
Contributor Author

esskar commented Jan 10, 2025 via email

@aaronpowell
Copy link
Member

Check out any of the ones in https://github.com/dotnet/docs-aspire/tree/main/docs/community-toolkit as a reference point

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration A new .NET Aspire integration
Projects
None yet
Development

No branches or pull requests

3 participants