-
Notifications
You must be signed in to change notification settings - Fork 198
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
[CORS] allow requests to be handled by locally running proxy #882
Comments
Expanding on that last point (which admittedly is tangential to this issue), for example I want do develop something using OBS WebSocket. It is a known issue (obsproject/obs-websocket#26, WICG/private-network-access#23) that we cannot mix security contexts. The stated solution is to use |
Recently started another project that would be greatly helped by this (working with locally served map tiles that I won't want to load into the webcontainer). Having to send them for a trip around the internet via ngrok is really not ideal. @SamVerschueren apologies for the ping, but it would be nice to know the if this is being tracked, thanks! |
Hi @randName. We're discussing internally how something like this could work. We do agree that having a way to send traffic to a service that runs on your host machine is a very good use case that we need to support. I will get back to you if I have more information. |
just thought I should come back with a workaround I found in the meantime, which is *the key tutorials to follow:
|
As mentioned in many other issues (e.g. #142), CORS cannot be bypassed unless using some browser extension to work around it.
Also, using
localhost
to access the actual computer localhost does not really work and we have to use a workaround (e.g. the actual computer IP instead).Describe the solution you'd like:
The idea is to allow StackBlitz to capture requests for a certain set of domains and redirect them to a locally running proxy
e.g. detect calls to
https://some.noncors.api/*
and transparently redirect tohttp://<some way of actually getting localhost>:8080/:path
, and then run your own server listening at 8080 (e.g. something like this https://gist.github.com/randName/88c7c2fc7a30890ed31b0dae14b29d24 )Describe alternatives you've considered:
for frontend apps I think
http-proxy
can achieve something to that effect, but if it is a pure node app you have to do it manually (e.g. override global fetch)for example, if some library to interact with an API does not allow me to change URLs, I'm stuck unless I dig into that library.
Additional context:
I have mentioned this previously on discord, and it is even more important now that Codeflow can handle almost everything except CORS.
I can run local databases and other services but getting access to them is a bit of a pain (especially since it is not
localhost
and thus no longer a secure context,https
is required)The text was updated successfully, but these errors were encountered: