关于如何架设PT请参考:NexusPHP架设PT服务站点教程

安装完成后发现可以局域网内可以做种,但是外网就不行了,查看种子下载地址列表会显示可连接性为否,查看了announce.php文件,可连接性由这段代码决定

    $sockres = @pfsockopen($ip, $port, $errno, $errstr, 5);
    if (!$sockres)
    {
        $connectable = "no";         //不可连接
    }
    else
    {
        $connectable = "yes";       //可连接
        @fclose($sockres);
    }

 

 我查看了php参考手册pfsockopen函数,这里只能对ipv4支持,如果要支持ipv6可以改成如下形式

if (strlen( $ip ) > 15)$protocol==6;
if($protocol==6);    //判断是否为ipv6地址
        $sockres = @pfsockopen("tcp://[".$ip."]",$port,$errno,$errstr,5);
    else
        {
$sockres
= @pfsockopen($ip,$port,$errno,$errstr,5);
}
if (!$sockres) { $connectable = "no"; } else { $connectable = "yes"; @fclose ( $sockres ); }

 

参考资料:http://blog.chinaunix.net/uid-93477-id-3249521.html

相关文章:

  • 2021-04-24
  • 2018-04-10
  • 2022-12-23
  • 2021-09-04
  • 2021-11-02
  • 2021-05-28
  • 2021-07-03
  • 2021-06-18
猜你喜欢
  • 2021-10-29
  • 2022-02-05
  • 2021-10-07
  • 2022-12-23
  • 2021-09-07
相关资源
相似解决方案