Skip to content

[Reverse Proxy] Modify reverse proxy request #1155

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

Closed
nettnikl opened this issue May 20, 2022 · 4 comments · Fixed by #1252
Closed

[Reverse Proxy] Modify reverse proxy request #1155

nettnikl opened this issue May 20, 2022 · 4 comments · Fixed by #1252
Assignees
Labels
Proposal Proposals for futuristic feature requests

Comments

@nettnikl
Copy link

Is your feature request related to a problem? Please describe.
I am implementing a reverse proxy which does some stuff to the requests before forwarding. I've tried flask, but i need a solution able to handle big files, so i came here. My project needs to be implemented in python for unrelated reasons.

Currently for debugging purposes i'm modifying proxy/http/server/reverse.py:89 ff, uncommenting the "Update Host header" change, and this is fine-ish for development.
But i'm planning to use this in production, and adding more functionality there, so i'd need a way to modify requests going upstream.

Describe the solution you'd like
Some method to overwrite in the reverse proxy base plugin where i can modify the requests - while still being able to directly stream big upstream content (think of a TB here).

Describe alternatives you've considered

  • implementing parts of the solution in python, and the actual handling of proxied content in nginx or similar
  • forking this code and adding it directly, which makes it hard to update and maintain
  • different reverse proxy projects in python (are there even any production ready ones actually?)

Additional context
This possibility was already suggested to be possible in #1045

In-fact, we can provide a ReverseProxyBasePlugin hook which allows developers to modify the request before dispatching to upstream server.

@abhinavsingh
Copy link
Owner

IIUC correctly, we are talking about following feature

We'll likely address it in upcoming release, include support for self-signed certificates, ability to provide custom openssl path. I estimate this to be out next month sometime. I hope that fits with your project timeline.

@nettnikl nettnikl changed the title Modify Modify reverse proxy request May 20, 2022
@nettnikl
Copy link
Author

Thank you for the quick response.
Next month sounds good for a release - for now, what branch can you recommend to look at for developing a demo?

@abhinavsingh
Copy link
Owner

@nettnikl Unfortunately, there is no current branch. I believe once onto it, might take a few hours to carve out a developer level APIs for reverse proxy ecosystem. Till then feel free to hack through it :). I'll try to gather various requirements that folks have added through several issues/discussions and try to encapsulate the same in the APIs

@abhinavsingh abhinavsingh added the Proposal Proposals for futuristic feature requests label May 24, 2022
@abhinavsingh abhinavsingh changed the title Modify reverse proxy request [Reverse Proxy] Modify reverse proxy request Jul 19, 2022
@abhinavsingh
Copy link
Owner

@nettnikl #1252 will add support for modifying the request object before the request gets routed. Give it a try when you can. Let me know if this isn't working as expected. Best

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Proposal Proposals for futuristic feature requests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants