MyBB-Plugins Forums

Full Version: Image Proxy (SSL)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey. I installed SSL to my Server, but seems that absolute images with http:// breaks the SSL. I need images with https:// to make SSL working correctly.

I already made very little and simple image proxy:

PHP Code:
<?php
header
('Content-Type: image/png');
if(isset(
$_GET['srcimg'])){echo file_get_contents($_GET['srcimg']);}
?>

so you can get the image trough our server, https://myserver.com/imgproxy.php?imgsrc=$1

This works as it should, but i need to get every <img src=""> and [img] links replaced with that proxy. I couldn't find any plugin to do this and i have no idea how to implent it with MyBB..

If you have easier way to do this, please tell, or if you have plugin/knowledge of PHP & MyBB, tell me how can i do this.

EDIT:
-------
E.g. Members signatures may contain image thats from site what does not use SSL (or is not forced). Also, everything inside <img src=""> and [img] tags should be replaced with "././imgsrc=${image_url_here}"
Hi,

Can you give me an example of where the img tag is not properly using HTTPS? User signatures obviously have that problem and you'd probably need the code you added above to perform the redirecting (with some plugin performing the link replacement when the user changes the signature).
Uhm.. When user adds image from some site that does not force https:// (like i.mgur), it will break the SSL..
Atm. problem is, how to get every img link posted to our forums, go trough the proxy.

Sorry, i am not pro with these things :/

EDIT::

I think i just need plugin that redirects any link with .png/.jpge/.. trough the proxy. I don't know about MyBB, but this works with Xenforo (As there is plugin for that).
Yes, you would definitely need a plugin for that.
(01-02-2016, 10:37 PM)Diogo Parrinha Wrote: [ -> ]Yes, you would definitely need a plugin for that.

Think you could PM me with a quote for something like this? Smile
To bring this thread back a live, how hard is it to create plugin like that? I know i can route everything trough SSL, but it will affect other things in my board. How long it may take to create plugin, what reroutes traffic trough the proxy? Its already developed to Xenforo, but no one never developed it to MyBB.

I also tested this Camoserver what someone suggested, but doesn't work either..
For a plugin quote, please post in the Custom Plugins -> Quotes & Discussion forum.