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

Handle redirection #138

Open
MarcAntoine-Arnaud opened this issue Sep 23, 2021 · 5 comments
Open

Handle redirection #138

MarcAntoine-Arnaud opened this issue Sep 23, 2021 · 5 comments
Labels

Comments

@MarcAntoine-Arnaud
Copy link

Hello,

Do you think it's possible to add a redirection option for a path/subpath ?

Expected:

http --redirect /some:http://localhost:4000

Thanks,
Marc-Antoine

@thecoshman
Copy link
Owner

Kinda feels like something that you could solve by having nginx (or the likes) sitting in front of http.

@nabijaczleweli
Copy link
Collaborator

HTML can contain a redirect as <meta http-equiv.
For more generic ones that match on large swathes of paths (like your example I assume is): use a rproxy. Otherwise this is homologous to header path filtering (which you by definition need to specify different redirects).

@kuon
Copy link

kuon commented Feb 25, 2022

For development, it is really handy to be able to proxy some path, like http://tapiov.net/live-server/

@thecoshman
Copy link
Owner

For development, it is really handy to be able to proxy some path, like http://tapiov.net/live-server/

Are wanting/expecting http to intercept that call when you try to load it in your browser? 🤔

@kuon
Copy link

kuon commented Feb 25, 2022

I would love to be able to do:

http . --proxy=/api:https://myserver.com/api

Then, in the html file, any ajax call to /api would be forwarded without any CORS required.

This is really handy in development.

There are two important points:

  • the Origin header should be set to the server, in my example, it should be myserver.com
  • redirects should not be followed, and instead handled by the browser

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

No branches or pull requests

4 participants