Proxy images requiring headers with JavaScript.
- Clone via
git clone https://github.com/Eltik/image-proxy
. - Run
npm i
oryarn install
. - Run
npm run build
. - Add
PORT
to your.env
file (see.env.example
). - Run
npm run start
.
After you setup the proxy, to proxy images just use https://<PROXY_URL_HERE>/image-proxy?url=<encoded_url_here_>&headers=<stringified_and_encoded_headers_here>
. For example:
const image = `http:https://localhost:3000/image-proxy?url=${encodeURIComponent("https://scans-ongoing-1.lastation.us/manga/Kubo-san-wa-Boku-Mobu-wo-Yurusanai/0144-019.png")}&headers=${encodeURIComponent(JSON.stringify({ Referer: "https://mangasee123.com" }))}`;
// Output: http:https://localhost:3061/image-proxy?url=https%3A%2F%2Fscans-ongoing-1.lastation.us%2Fmanga%2FKubo-san-wa-Boku-Mobu-wo-Yurusanai%2F0144-019.png&headers=%7B%22Referer%22%3A%22https%3A%2F%2Fmangasee123.com%22%7D
Then on your website, the images should appear normally.