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

Add passthrough flag for proxy #290

Merged
merged 1 commit into from Dec 29, 2022
Merged

Add passthrough flag for proxy #290

merged 1 commit into from Dec 29, 2022

Conversation

paulgb
Copy link
Member

@paulgb paulgb commented Dec 23, 2022

This adds a flag to the proxy to allow a "passthrough" SocketAddr used when a backend can't be resolved. All unknown hosts will be proxied to this backend, but it will all be TLS terminated with the same certificate, so if this is used to resolve other hostnames a custom certificate will need to be passed in which covers all of them.

Only HTTP is supported for the upstream connection.

This will close #289.

@aws-amplify-us-east-1
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-290.d1ifbpoduxv8ai.amplifyapp.com

@rolyatmax
Copy link
Member

From this comment

One possibility would be to allow a "fallback" address that anything that is not a current backend is proxied to. In a multi-drone context this would provide a way to display a custom page when an invalid domain is accessed.

If I'm understanding correctly, user visits status.example.com, Plane DNS sends them to a drone (?), the drone's proxy doesn't find a status backend and so proxies to the passthrough upstream? How does Plane DNS know to send status.example.com to a drone?

@paulgb
Copy link
Member Author

paulgb commented Dec 25, 2022

The use case where this came up is a situation with just one Drone, where Plane DNS isn’t used at all. Instead, status.blah.blah is caught by a wildcard DNS record and sent to the IP that Plane is running on.

Another use case is custom error pages when DNS is cached (so we don’t have a chance to serve NXDOMAIN) but a backend has been swept. Currently we serve a plain 404 in this case, but this could be used to serve a custom error page.

@paulgb paulgb merged commit 26e90ff into main Dec 29, 2022
@paulgb paulgb deleted the paulgb/proxy-passthrough branch December 29, 2022 16:34
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.

Drone Proxy: Allow Custom Routes
3 participants