Rob--W / cors-anywhere

CORS Anywhere is a NodeJS reverse proxy which adds CORS headers to the proxied request.
MIT License
8.57k stars 5.99k forks source link

Question: using an image url that has a 5mb file, does cors-anywhere transfer 5mb back to client, or does client downloads from the original image hosting server? #389

Open branlok opened 2 years ago

Rob--W commented 2 years ago

CORS Anywhere is a proxy. The destination server sends 5 MB of data to CORS anywhere, and CORS Anywhere forwards the response to the client.

CORS anywhere streams the response from the destination server to the client, so the latency (and memory usage on the server) is minimal.

branlok commented 2 years ago

CORS Anywhere is a proxy. The destination server sends 5 MB of data to CORS anywhere, and CORS Anywhere forwards the response to the client.

CORS anywhere streams the response from the destination server to the client, so the latency (and memory usage on the server) is minimal.

thank you for the answer!

This may be slightly more than what I was asking, but since im hosting this on a free tier with heroku that has a "Network bandwidth is soft limited at 2TB per app per month." besides blacklisting, rate limiting.. say can I abort any request that are asking for data of some arbitrary large file sizes?

and just to reconfirm , CORS Anywhere proxy would take 5MB dl from destination server, and 5MB stream back to client. the total network bandwidth used here is 10MB on heroku side of things?

thank you

Rob--W commented 2 years ago

This may be slightly more than what I was asking, but since im hosting this on a free tier with heroku that has a "Network bandwidth is soft limited at 2TB per app per month." besides blacklisting, rate limiting.. say can I abort any request that are asking for data of some arbitrary large file sizes?

That's not possible. But Heroku terminates requests after 30 seconds, which would reduce the impact.

and just to reconfirm , CORS Anywhere proxy would take 5MB dl from destination server, and 5MB stream back to client. the total network bandwidth used here is 10MB on heroku side of things?

Yes.