Skip to main content

SOCKS client and server based on asyncio

Project description



This is a SOCKS server and client package built with asyncio (requires Python 3.5+).


$ pip3 install gera2ld.socks


  • SOCKS server

    shell command:

    # Start a server
    $ python3 -m gera2ld.socks.server -b

    or python script:

    from gera2ld.pyserve import run_forever
    from gera2ld.socks.server import Config, SOCKSServer
    config = Config('')
  • SOCKS client

    import asyncio
    from gera2ld.socks.client import create_client
    client = create_client('socks5://')
    loop = asyncio.get_event_loop()
    loop.run_until_complete(client.handle_connect(('', 80)))
  • SOCKS handler for urllib

    from urllib import request
    from gera2ld.socks.client.handler import SOCKSProxyHandler
    handler = SOCKSProxyHandler('socks5://')
    opener = request.build_opener(handler)
    r ='')
  • SOCKS client for UDP

    import asyncio
    from gera2ld.socks.client import create_client
    async def main():
        client = create_client('socks5://')
        udp = await client.handle_udp()
        udp.write_data(b'\xc9\xa7\x01\x00\x00\x01\x00\x00\x00\x00\x00\x00\x03www\x06google\x03com\x00\x00\xff\x00\x01', ('', 53))
        print(await udp.results.get())
    loop = asyncio.get_event_loop()

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for gera2ld.socks, version 0.4.5
Filename, size File type Python version Upload date Hashes
Filename, size gera2ld.socks-0.4.5-py3-none-any.whl (16.4 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size gera2ld.socks-0.4.5.tar.gz (10.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page