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

proxyTo with request URI regexp matching #14

Closed
VoDmAl opened this issue Jul 20, 2023 · 2 comments
Closed

proxyTo with request URI regexp matching #14

VoDmAl opened this issue Jul 20, 2023 · 2 comments

Comments

@VoDmAl
Copy link

VoDmAl commented Jul 20, 2023

Thanks for the great solution for simulating requests to remote services.

I tried, but couldn't find how in "proxyTo" mode I can pass the original request URI. In the "response" mode, it is possible to use regexp matching. But it does not work for a proxy.

{
  "version": "2",
  "on": {
    "url": { "matches": "~^/v3/(.*)~"}
  },
  "then": {
    "proxyTo": "https://example.com/v3/${url.1}"
  },
  "priority": 0
}

So when I send request to http://127.0.0.1/v3/some/thing, I would like to see it to be proxied to https://example.com/v3/some/thing

Perhaps I made some mistake? If this is not possible, can it be added?

Thank you!

@mcustiel
Copy link
Owner

Hello @VoDmAl
Thanks for pointing it out. Right now it is not possible to do what you are trying, but I think it's possible to implement it.
I will do it in the next days.

@VoDmAl
Copy link
Author

VoDmAl commented Aug 14, 2023

Awesome! You did a lot of refactorings, adding this feature. Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants