Skip to content

Instantly share code, notes, and snippets.

@milnerm
milnerm / gist:2877e2f1e950e0da631edd568880e0ba
Created December 11, 2017 17:25
Basic cURL PHP http to local https pass through
<?php if(!empty($_GET['httpurl'])){
/**
* Basic cURL script for passing http through https locally, to get around mixed-security issues in browsers
* not fully tested; can handle GET and POST data as needed.
* $_GET['httpurl'] is urlencoded
*/
$cookie = tmpfile();
$userAgent = 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.64 Safari/537.31';
$thisurl=urldecode($_GET['httpurl']);
//basic check for domain