Skip to content

Commit

Permalink
Fix proxy argument
Browse files Browse the repository at this point in the history
  • Loading branch information
nibrag committed Apr 15, 2017
1 parent b98ae65 commit 7703160
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ aiohttp usage
import asyncio
import aiohttp
import aiosocks
from yarl import URL
from aiosocks.connector import ProxyConnector, ProxyClientRequest
Expand All @@ -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())
Expand Down

0 comments on commit 7703160

Please sign in to comment.