Skip to main content

No project description provided

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 http://12.186.205.120:80
http://12.186.205.120:80 ... is alive
anonymity: high_anonymous
country: US
response time: 4.71 (secs)

$ valid_proxy https://12.186.205.120:80
https://12.186.205.120:80 ... is alive
anonymity: transparent
country: US
response time: 0.5 (secs)

$ valid_proxy http://2.189.59.54:80
http://2.189.59.54:80 ... is dead

Project details


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.2.6.tar.gz (3.1 MB view hashes)

Uploaded Source

Built Distribution

py_valid_proxy-0.2.6-py3-none-any.whl (3.1 MB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page