You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 to http://<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:
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 ngrok, but that assumes we can control the URL even with libraries (fortunately for OBS WebSocket, most of the time it can be done). Ideally we shouldn't need ngrok for local development.
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.
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: