cors-anywhere icon indicating copy to clipboard operation
cors-anywhere copied to clipboard

No Server Response (Repl.it)

Open splch opened this issue 5 years ago • 7 comments

Problem

Hi! I'm trying to make a daily wallpaper website, but am running across a problem when trying to host cors-anywhere from Repl.it.

The page loads here, but there is no server response for URLs.

Cors' Code

Cors' Code

Script Evocation

Evocation

I would greatly appreciate any help with figuring out how to make cors-anywhere work on Repl.it. Thank you!

splch avatar Aug 06 '20 02:08 splch

The URLs are all formatted to https:/www., and I noticed this comment and confirmed the forward-slash shortening with this suggestion. I'm not sure how I would begin applying a solution to repl.it though.

splch avatar Aug 06 '20 02:08 splch

I just imported the repo without changes via repl.it, and it works just fine (verified by using curl to load http://localhost:8080/https://example.com).

Side note: Do not remove requireHeader from the configuration. It is very insecure to do so because it would allow others to load third-party websites in your domain.

Rob--W avatar Aug 06 '20 17:08 Rob--W

@Rob--W Would you be able to share your repl? Even after cloning the repository into repl.it, the server refuses to process the URLs.

splch avatar Aug 06 '20 23:08 splch

https://repl.it/repls/InsubstantialExtrovertedPixels

Install dependencies and start server from shell:

npm ci
node server.js &

Test request:

curl http://localhost:8080/http://example.com/anywhere -H 'Origin: http://example.net'

Rob--W avatar Aug 06 '20 23:08 Rob--W

@Rob--W This is interesting... curling from the repl.it terminal works but an xmlhttp get request does not. It also doesn't seem possible to host on port 443 or 80. Is it wrong to assume we can't use repl.it as a server for get requests?

splch avatar Aug 06 '20 23:08 splch

Yeah @splch, I have the same problem as you.

RoyceAroc avatar Aug 17 '20 15:08 RoyceAroc

I'm not going to type the source code from the image. If you want me to look into it, then please share a minimal project with a clear description (reproduction steps).

Rob--W avatar Aug 17 '20 23:08 Rob--W