test-port.php -- source code?

User avatar
brettalton
Member
Member
Posts: 21
Joined: Sun Oct 28, 2007 11:29 pm

test-port.php -- source code?

Postby brettalton » Fri May 23, 2008 9:02 pm

Can I see the source code to test-port.php? I'm interested in how it works.

gerdradecke
Member
Member
Posts: 11
Joined: Thu Aug 02, 2007 8:15 pm

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

Postby gerdradecke » Sun Jun 01, 2008 8:30 pm

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

markybob
Compulsive Poster
Compulsive Poster
Posts: 1230
Joined: Thu May 24, 2007 11:27 pm
OS or Distro: Debian
Location: Chicago, IL, USA
Contact:

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

Postby markybob » Mon Sep 29, 2008 4:01 am

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();
?>


Return to “Off-topic Discussion”

Who is online

Users browsing this forum: No registered users and 1 guest