Skip to main content

Library for create proxy tunnels

Project description

made-with-python PyPI-version Hit-Count Downloads

Library for create/generation proxy tunnels.

Installation

$ pip3 install ProxyTuneller

Examples

Create proxy tunnel

import asyncio
from ProxyTunneller import Proxy, Tunnel


await def main():
    inner_proxy = Proxy('http', '104.28.10.155', 80)
    outer_proxy = Proxy('socks5', '5.9.143.59', 3128)
    tunnel = Tunnel(inner_proxy, outer_proxy)
    await tunnel.build
    print(tunnel.url)

if __name__ == '__main__':
    asyncio.run(main())

Generate tunnels from proxy-pools

import asyncio
from ProxyTunneller import Proxy, TunnelGenerator


await def main():
    inner_proxies = [
        Proxy('http', '104.28.10.145', port)
        for port in range(12040, 12054)
    ]
    outer_proxies = [
        Proxy('socks5', '138.197.157.44', port)
        for port in range(40055, 40200)
    ]

    queue = asyncio.Queue()
    generator = TunnelGenerator(queue, inner_proxies, outer_proxies)
    # support transparent tunnels
    generator.allow_only_invisible_tunnels = False
    # close each tunnel in 20 minutes after opening (0 - not close)
    generator.tunnels_lifetime = 20*60
    generator.run()
    while True:
        try:
            tunnel = await asyncio.wait_for(queue.get(), 60)
        except asyncio.TimeoutError:
            break
        print(tunnel.url)


if __name__ == '__main__':
    asyncio.run(main())

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

ProxyTunneller-0.1.0.tar.gz (3.9 kB view hashes)

Uploaded Source

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