From 7703160efc69f599f20c0bd85aa3086b28f9303f Mon Sep 17 00:00:00 2001 From: nibrag Date: Sat, 15 Apr 2017 20:29:48 +0300 Subject: [PATCH] Fix proxy argument --- README.rst | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index 5481306..333ea0f 100644 --- a/README.rst +++ b/README.rst @@ -142,7 +142,6 @@ aiohttp usage import asyncio import aiohttp import aiosocks - from yarl import URL from aiosocks.connector import ProxyConnector, ProxyClientRequest @@ -160,19 +159,19 @@ aiohttp usage try: with aiohttp.ClientSession(connector=conn, request_class=ProxyClientRequest) as session: # socks5 proxy - async with session.get('http://github.com/', proxy=URL('socks5://127.0.0.1:1080'), + async with session.get('http://github.com/', proxy='socks5://127.0.0.1:1080', proxy_auth=auth5) as resp: if resp.status == 200: print(await resp.text()) # socks4 proxy - async with session.get('http://github.com/', proxy=URL('socks4://127.0.0.1:1081'), + async with session.get('http://github.com/', proxy='socks4://127.0.0.1:1081', proxy_auth=auth4) as resp: if resp.status == 200: print(await resp.text()) # http proxy - async with session.get('http://github.com/', proxy=URL('http://127.0.0.1:8080'), + async with session.get('http://github.com/', proxy='http://127.0.0.1:8080', proxy_auth=ba) as resp: if resp.status == 200: print(await resp.text())