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
I'm trying to test endpoints of my Node.js app running on localhost:3000 making requests from my Flutter web app running on localhost:5000 and I get the infamous 'No 'Access-Control-Allow-Origin' header is present on the requested resource.' error. So I'm trying to use local-core-proxy..
In my package.json scripts I added "proxy": "lcp --proxyUrl http://localhost --port 3000" .. and if I got right this should generate localhost:3000/proxy domain which I 'd use for my request as:
final Uri uri = Uri.http('localhost:3000',
'/proxy/api/products');
But when making the request I still get the error:
Access to XMLHttpRequest at 'http://localhost:3000/proxy/api/products' from origin 'http://localhost:5000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Am I missing to set something?
Many thanks for this package.
The text was updated successfully, but these errors were encountered:
I tried starting the proxy with lcp --proxyUrl https://localhost:3000 --port 3001 in terminal and got :
Proxy Active
Proxy Url: https://localhost:3000
Proxy Partial: proxy
PORT: 3001
Credentials: false
Origin: *
To start using the proxy simply replace the proxied part of your url with: http://localhost:3001/proxy
so in my Flutter web app I make the request to String uri = 'http://localhost:3001/proxy/api/products'; but I get net::ERR_CONNECTION_REFUSED error.
What am I doing wrong??
I'm trying to test endpoints of my Node.js app running on localhost:3000 making requests from my Flutter web app running on localhost:5000 and I get the infamous
'No 'Access-Control-Allow-Origin' header is present on the requested resource.' error
. So I'm trying to use local-core-proxy..In my package.json scripts I added "proxy": "lcp --proxyUrl http://localhost --port 3000" .. and if I got right this should generate
localhost:3000/proxy
domain which I 'd use for my request as:But when making the request I still get the error:
Am I missing to set something?
Many thanks for this package.
The text was updated successfully, but these errors were encountered: