New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

proxy-spinner

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

proxy-spinner

ProxySpinner is an straightforward, non-reliable, non-secure, but easy-to-use library for avoiding IP blocking by rotating free proxies on demand. It relies in services like proxyscrape.com to get the proxies and rotates them on demand, and is subject to the availability of that service and the proxies it lists.

pipPyPI
Version
0.5
Maintainers
1

Proxy Spinner

ProxyRotator is an straightforward, non-reliable, non-secure, but easy-to-use library for avoiding IP blocking by rotating free proxies on demand. It relies in services like ProxyScrape.com to get the proxies and rotate them on demand, and is subject to the availability of that service and the proxies it lists.

Installation

pip install proxy-spinner

Usage

from proxy_spinner import ProxySpinner
import requests

# Initialize the proxy rotator. By default it uses no proxy until you call renew_proxy
proxy_manager = ProxySpinner()
# Renew the proxy to use a new one. Could take a while to find a working one
found_proxy = proxy_manager.renew_proxy()

# Use the proxy in your requests within a context manager
with proxy_manager:
    response = requests.get("https://cmp.inmobi.com/geoip").json()
    print(f"PROXY ENABLED: You are at  {response['city']} ({response['country']}) "
          "[Proxy: {found_proxy}]")

# Without the context manager, the proxy is not used
response = requests.get("https://cmp.inmobi.com/geoip").json()
print(f"PROXY DISABLED: You are at  {response['city']} ({response['country']})")

Output:

PROXY ENABLED: You are at budapest (hun) [Proxy: 178.48.68.61:18080]
PROXY DISABLED: You are at ********** (esp)

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts