Skip to content
This repository has been archived by the owner on Feb 14, 2022. It is now read-only.

0xCP/miniProxy

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

miniProxy

A tiny PHP proxy

<?php
if(preg_match("{^(https?://)?(www\.)?(example\.com|example\.net)/}",$url=preg_replace("{^.*?url=}","",$_SERVER['REQUEST_URI'])))readfile($url);
else die("Bad URL");
  • Can be used to get any file or XHR request from another domain, with or without HTTPS.
  • Can proxy any URL, even if it contains its own GET parameters.
  • Requires a PHP server.
  • doesn't proxy the original headers or MIME-types. Only the data.
  • to avoid security breaches, you need to whitelist your target domain(s) by editing the (example\.com|example\.net) part.

Usage:

// AJAX
x = new XMLHttpRequest();
x.open("GET", "proxy.php?url=" + url, true);
x.send(null);
<!-- image -->
<img src="proxy.php?url={url}/image.gif">

<!-- video -->
<video src="proxy.php?url={url}/image.mp4">

<!-- binary file download -->
<a download="file.zip" href="proxy.php?url={url}/file.zip">download</a>

About

PHP proxy that works for 99.9% of your cross-domain needs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%