简体   繁体   English

Python-确定ip是否为代理

[英]Python - Determine if ip is proxy or not

Is there any way how to find out, if ip address comming to the server is proxy in Python? 如果要发送给服务器的IP地址是Python中的代理,有什么方法可以找到?

I tried to scan most common ports, but i don't want to ban all ips with open 80 port, because it don't have to be proxy. 我尝试扫描最常见的端口,但是我不想禁止所有具有开放80端口的ip,因为它不必是代理。

Is there any way how to do it in Python? 有什么办法可以在Python中做到吗? I would prefere it before using some external/paid services. 在使用某些外部/付费服务之前,我更喜欢它。

If it's a HTTP traffic, you can scan for headers like X-Forwarded-For . 如果是HTTP流量,则可以扫描X-Forwarded-For类的标头。

But whatever you do it will always be only a heuristic. 但是无论您做什么,都将永远只是一种启发。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM