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

proxy: Rewrite the proxy middleware #1639

Closed
mholt opened this issue May 1, 2017 · 9 comments
Closed

proxy: Rewrite the proxy middleware #1639

mholt opened this issue May 1, 2017 · 9 comments
Milestone

Comments

@mholt
Copy link
Member

mholt commented May 1, 2017

The proxy middleware needs to be rewritten, building upon the fabulous work already put in by contributors to date. These plans are tentative and subject to change.

It will be rewritten from scratch, but with very few (if any) Caddyfile syntax changes (hopefully). This is a "guided rewrite", meaning that the current proxy code (which is very intricate) will be used as a reference for the rewrite. My hope is that we can accomplish these goals to make Caddy into a more competitive, useful reverse proxy:

This may take a few weeks once work commences.

/cc @abiosoft @nemosupremo - I will probably have questions as I go through this, so expect to hear from me. :)

@mholt mholt self-assigned this May 1, 2017
@ghost
Copy link

ghost commented May 6, 2017

would this help achieve #1460 too?

@mholt
Copy link
Member Author

mholt commented May 7, 2017

@jrobeson Quite likely, yes. If I can do it right.

@Stonedestroyer
Copy link

Would this be implemented as well? #606 considering it pertains to the proxy plugin.

@mholt
Copy link
Member Author

mholt commented Jul 26, 2017

@Stonedestroyer Yes, I think it definitely could be.

@lvhuat
Copy link

lvhuat commented Oct 23, 2017

so,what the issue going on now?

@yura8
Copy link

yura8 commented Jan 5, 2018

This would help #1891 too.

@mholt mholt added the help wanted 🆘 Extra attention is needed label Mar 18, 2018
@mholt
Copy link
Member Author

mholt commented Mar 18, 2018

I won't have time to work on this for the coming year or so. If anyone is skilled in writing proxies and would like to take the lead at rewriting it, please chime in!

@mholt mholt removed their assignment Mar 27, 2018
@mholt mholt removed the help wanted 🆘 Extra attention is needed label Mar 25, 2019
@mholt mholt added this to the 2.0 milestone May 9, 2019
@mholt
Copy link
Member Author

mholt commented Oct 10, 2019

This rewrite is done in v2. It's not feature-complete but should be able to support all the features that have been requested, one way or another. (Contributions welcomed!)

The feature where a request is proxied to some arbitrary backends seems more suitable for a forward proxy than a reverse proxy. I'm not sure how that would work at all with a fixed number of backends.

@mholt mholt closed this as completed Oct 10, 2019
@mholt mholt modified the milestones: 2.0, v2.0.0-beta1 Oct 10, 2019
mholt added a commit that referenced this issue Oct 11, 2019
This PR enables the use of placeholders in an upstream's Dial address.

A Dial address must represent precisely one socket after replacements.

See also #998 and #1639.
@mholt
Copy link
Member Author

mholt commented Oct 11, 2019

Caddy 2 now allows a dynamic address for upstreams, as implemented in 1e31be8.

I think that pretty much finishes up this rewrite. There's still one matter related to error handling that I want to attend to but that's another open issue (#1447).

Go try it out!

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

No branches or pull requests

4 participants