|
#1
|
|||
|
|||
Image Proxy
Simple-Image-Proxy
The purpose of this image proxy is to reduce the exposure of the requesting sites url, when hot-linking images, by using the image proxy to make the http request, store the image and return the image from the image proxy in an http response. This could also be used to serve images that are using http links on your https site. Thereby not opening up a security hole. This image proxy will store an optimized for web version of the original image and can return that image in any dimensions that are included with the http request. How To: get the code Code:
git clone https://github.com/darkalchemy/Simple-Image-Proxy.git image-proxy Code:
chown -R www-data:www-data image-proxy Code:
cd image-proxy composer install edit settings.php Code:
replace the uid and key with values given to the requsting site. These values must match. add class with composer Code:
composer require blocktrail/cryptojs-aes-php Code:
use Blocktrail\CryptoJSAES\CryptoJSAES; Code:
$encrypted = CryptoJSAES::encrypt($url, $key); return 'http://image_proxy_url/image?' . base64_encode($encrypted . '&uid=' . uid); Code:
$encrypted = CryptoJSAES::encrypt("$url&width={$width}&height={$height}", $key); return 'http://image_proxy_url/image?' . base64_encode($encrypted . '&uid=' . uid); How to add to your site. The code is licensed MIT and is available on github. https://github.com/darkalchemy/Simple-Image-Proxy Last edited by darkalchemy; 11th February 2018 at 10:56. |
The Following User Says Thank You to darkalchemy For This Useful Post: | ||
romano1 (10th February 2018)
|
#2
|
|||
|
|||
Whats Pu-239? Ive searched the forums and cant find it i wanted to see the image proxy in action.
|
#3
|
|||
|
|||
Quote:
https://www.bvlist.com/forumdisplay.php?f=128 https://pu-239.pw https://github.com/darkalchemy/Pu-239 But, I removed the code for Image Proxy from GitHub because I could not make the images cache in the browser. So, I rolled the code into Pu-239. Now, the Image Proxy simply fetches the external image, manipulates it as desired, stores it and then displays it as an internal image. And.... every externally linked image displayed in my code is run through the Image Proxy, which can be disabled if desired. Last edited by darkalchemy; 17th December 2018 at 04:44. |
#4
|
|||
|
|||
Thx m8, maybe i used the wrong search word. I tried Pu-239 with no results.
|
#5
|
|||
|
|||
No worries, just giving you a hard time.
|
#6
|
|||
|
|||
All good m8, that many ppl post without looking that it kinda goes unsaid and if you found it by doing a search then im doing something wrong and should be pulled up on it lol
Ive checked out the source and see where it refrences the images to the proxy but im confused about the whole setup and im undecided about what to do. |
#7
|
|||
|
|||
Sorry, but you can't just pull it out of my code to use it in another. But, you can look at the function url_proxy() and the ImageProxy class.
Those 2 are responsible for handling the image proxy. |
Tags |
image , proxy |
|
|