discoverByHttp.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:pyfeld 作者: scjurgen 项目源码 文件源码
def get(self, url, ip, timeoutConnect, timeoutRead):
        headers = {
            'CONTENT-TYPE': 'text/xml; charset="utf-8"',
            'USER-AGENT': 'uPNP/1.0'
        }
        try:
            timeout = urllib3.util.timeout.Timeout(connect=timeoutConnect, read=timeoutRead)
            http = urllib3.PoolManager(timeout=timeout)
            r = http.request("GET", url, headers=headers)
            if r.status == 200:
                self.found_ip = ip
                print("found "+ip)
                self.kill_after_found()
        except Exception as e:
            pass
            #print("Request for '%s' failed: %s" % (url, e))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号