文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>用perl生成代理脚本

用perl生成代理脚本

时间:2005-11-11  来源:hellwolf

我们学校的免费ip地址列表需要查询https://account.seu.edu.cn/ip/free.html,格式为:
10.0.0.0 0.255.255.255 255.0.0.0 

这样的
我用perl写了个自动生成代理脚本的代码:

#!/bin/env perl

use strict;

open(LIST,'elinks --dump http://account.seu.edu.cn/ip/free.html |')
or die "error open freeip webpage";

print <
function FindProxyForURL(url, host){
if(isPlainHostName(host) || dnsDomainIs(host,".ieeexplore.ieee.org")) return "DIRECT";
HEADER
;

while (){
next if ( ! m/d+.d+.d+.d+/);
$_ =~ s/ *(.*) */1/g;
$_ =~ s/ //g;
(my $ip,undef,my $longmask) = split(/[ ]+/);
print " else if(isInNet(host,"$ip","$longmask"))return "DIRECT"; ";
}

print <
else return "PROXY __RPOXYHOST__:__PROXYPORT__";
}
TAIL

相关阅读 更多 +
排行榜 更多 +
地狱摩托游戏最新版下载

地狱摩托游戏最新版下载

赛车竞速 下载
小猫快来钓鱼游戏下载

小猫快来钓鱼游戏下载

休闲益智 下载
殴打氪金大佬昊天手游下载

殴打氪金大佬昊天手游下载

休闲益智 下载