test-port.php -- source code?
- brettalton
- Member
- Posts: 21
- Joined: Sun Oct 28, 2007 11:29 pm
test-port.php -- source code?
Can I see the source code to test-port.php? I'm interested in how it works.
-
- Member
- Posts: 11
- Joined: Thu Aug 02, 2007 8:15 pm
Re: test-port.php -- source code?
dunno if you need the exact deluge test-port code, but since utorrent pretty much does the same, afaik, this should help you:
http://forum.utorrent.com/viewtopic.php?id=38356
http://forum.utorrent.com/viewtopic.php?id=38356
-
- Compulsive Poster
- Posts: 1230
- Joined: Thu May 24, 2007 11:27 pm
- Location: Chicago, IL, USA
- Contact:
Re: test-port.php -- source code?
it's no secret. here it is:
Code: Select all
<?php
error_reporting(0);
$host = $_SERVER['REMOTE_ADDR'];
$i = $_GET['port'];
$fp = fsockopen("$host",$i,$errno,$errstr,10);
if($fp){
echo "TCP port " . $i . " open on " . $host . "<br><br>Yay! :-)";
fclose($fp);
}
else{
echo "TCP port " . $i . " closed on " . $host . "\n";
}
flush();
?>