Created
January 28, 2012 23:37
-
-
Save qsun/1696289 to your computer and use it in GitHub Desktop.
Convert squid proxy list to switch proxy list
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Squidproxies List to SwitchProxy</title> | |
</head> | |
<body> | |
<h1>An easy way to switch squidproxies to SwitchProxy</h1> | |
<form method="post"> | |
<label>Please input your proxy list</label><textarea name="proxies" cols="80" rows="10"></textarea> | |
<br /> | |
<input type="submit" /> | |
</form> | |
<?php | |
if ($_POST['proxies']) { | |
$proxies = explode("\n", $_POST['proxies']); | |
$count = 0; | |
$switch_proxy = ''; | |
foreach ($proxies as $proxy) { | |
$p = strip_tags(trim($proxy)); | |
if ($p) { | |
$switch_proxy = $switch_proxy . "\n[squid{$count}\nall={$p}\nclear=cache\n]\n"; | |
$count++; | |
} | |
} | |
?> | |
<h2>Result</h2> | |
<textarea rows="80" cols="80"> | |
<?php echo $switch_proxy; ?> | |
</textarea> | |
<hr /> | |
<?php | |
} | |
?> | |
<div class="footer"> | |
<a href="http://www.squidproxies.com/billing/aff.php?aff=347">Squid Proxies</a> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment