How can I check if a SOCKS server is working?
I'd like to periodicity check if my SOCKS 5 server is working fine. Just pinging the server or successfully connecting to the SOCKS service is not enough for me. I'd like to check that th开发者_JAVA技巧e server is actually working, by successfully downloading an HTML file, for example (Or any other reasonable way).
How should I check it? How can I do it?
Thanks.
Try the pycyurl library, as it supports SOCKS 5 proxies. Another answer shows how to use it. You could then use smtplib to send you an email if your proxy is down, and drop the finished script in your crontab (or some other means of automating it).
精彩评论