flask-restplus icon indicating copy to clipboard operation
flask-restplus copied to clipboard

"Can't read from server" when using Ngrok to make localhost tunnel

Open rizkiaditya24 opened this issue 7 years ago • 4 comments

Hi, I've got an error whenever I try to make a localhost tunnel using Ngrok. If I go to the URL provided by ngrok, It should display the Swagger UI instead I got "Can't read from server. It may not have the appropriate access-control-origin settings." .

If I access to localhost, it works just fine, but when I access the ngrok URL, it doesn't work at all. How to make it works, so that I can access the Swagger UI via ngrok url?

rizkiaditya24 avatar Jul 03 '17 23:07 rizkiaditya24

Please check if adding Flask-CORS library will solve your problem.

synweap15 avatar Jul 06 '17 20:07 synweap15

@synweap15 I've tried to add flask-cors, and I see there's "Access-Control-Allow-Origin: *" in the header for every response, but it still doesn't work.

rizkiaditya24 avatar Jul 06 '17 21:07 rizkiaditya24

Do you see any other errors in the devtools console?

martijnarts avatar May 16 '18 14:05 martijnarts

@rizkiaditya24 did you found any solution for this?

chakravarthi-vl avatar Jun 03 '21 09:06 chakravarthi-vl