(转)判断网站是否可以连接
By
admin
at 2018-10-17 • 0人收藏 • 1572人看过
import inet.http; //创建http对象 var http = inet.http(); http.setTimeouts ( 1000,//连接超时 1000,//请求超时 1000 //接收超时 ) html = http.get("http://www.google.com.hk"); io.open() io.print( html )
import wsock.tcp.client; import inet.url;; var http = wsock.tcp.client() if( ! http.connectTimeout(inet.url.split(url).host,80,1 ) ){ console.log("连接超时",ip) return; }
整理自: aar群 感谢@何希尔 分享
登录后方可回帖