Skip to content
This repository has been archived by the owner on Nov 22, 2020. It is now read-only.

romis2012/aiosocksy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SOCKS proxy client for aiohttp 3.0+

DEPRECATED: please use new aiohttp-socks package

It`s a fork of aiosocks with minor fixes for aiohttp 3.0+ compatibility

Requirements

  • Python >= 3.5.3
  • aiohttp >= 3.0

Installation

pip install aiosocksy

Usage

import asyncio
import aiohttp
from aiosocksy import Socks5Auth
from aiosocksy.connector import ProxyConnector, ProxyClientRequest


async def fetch(url):
    auth = Socks5Auth(login='...', password='...')
    connector = ProxyConnector()
    socks = 'socks5://127.0.0.1:1080'
    async with aiohttp.ClientSession(connector=connector, request_class=ProxyClientRequest) as session:
        async with session.get(url, proxy=socks, proxy_auth=auth) as response:
            print(await response.text())


loop = asyncio.get_event_loop()
loop.run_until_complete(fetch('https://www.google.com/'))

see aiosocks for more examples

About

SOCKS proxy client for aiohttp 3.x

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages