Page 1 of 1

test-port.php -- source code?

Posted: Fri May 23, 2008 9:02 pm
by brettalton
Can I see the source code to test-port.php? I'm interested in how it works.

Re: test-port.php -- source code?

Posted: Sun Jun 01, 2008 8:30 pm
by gerdradecke
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

Re: test-port.php -- source code?

Posted: Mon Sep 29, 2008 4:01 am
by markybob
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();
?>