Valid proxy server ('alive' or 'dead')
Project description
py-valid-proxy
Installation
pip install py-valid-proxy
Usage
import pprint
from py_valid_proxy import valid_proxy
"""Valid proxy server ('alive' or 'dead')
Parameters
----------
host : str
IP Address
port : int
Port
scheme: str, optional
Scheme (default is 'http')
timeout: int, optional
Connect timeout is number of seconds (default is 5 sec.)
Returns
-------
None if proxy is 'dead'
class Proxy if proxy is 'alive'
"""
proxy_info = valid_proxy('8.219.97.248', 80, 'https', 10)
if proxy_info:
print('is alive')
pprint(proxy_info)
else:
print('is dead')
$ valid_proxy -h
usage: valid_proxy [-h] -ip IP -p P [-s {http,https}] [-t T] [-V]
Valid the functionality of the proxy server
options:
-h, --help show this help message and exit
-ip IP IP address of proxy server
-p P PORT of proxy server
-s {http,https} SCHEME of proxy server
-t T The connect timeout is the number of seconds
-V, --version show program's version number and exit
$ valid_proxy -ip 12.186.205.120 -p 80 -s http
http://12.186.205.120:80 ... is alive
anonymity: high_anonymous
country: US
response time: 4.71 (secs)
$ valid_proxy -ip 12.186.205.120 -p 80 -s https
https://12.186.205.120:80 ... is alive
anonymity: transparent
country: US
response time: 0.5 (secs)
$ valid_proxy -ip 2.189.59.54 -p 80
http://2.189.59.54:80 ... is dead
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
py_valid_proxy-0.3.0.tar.gz
(3.1 MB
view hashes)
Built Distribution
Close
Hashes for py_valid_proxy-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6c5abfaf75e2b71c3602c7fbbd95a6e59d8eee2b5c9d205798a84f67c31f45e |
|
MD5 | 51ba6d11ff51314ef78dca4dd97bf02c |
|
BLAKE2b-256 | 2c6a8eaab334fbd61f28723303798e30e71c2d1bf428a8be1b1a90c32cd58340 |