Skip to content

Commit 7703160

Browse files
committed
Fix proxy argument
1 parent b98ae65 commit 7703160

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

README.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ aiohttp usage
142142
import asyncio
143143
import aiohttp
144144
import aiosocks
145-
from yarl import URL
146145
from aiosocks.connector import ProxyConnector, ProxyClientRequest
147146
148147
@@ -160,19 +159,19 @@ aiohttp usage
160159
try:
161160
with aiohttp.ClientSession(connector=conn, request_class=ProxyClientRequest) as session:
162161
# socks5 proxy
163-
async with session.get('http://github.com/', proxy=URL('socks5://127.0.0.1:1080'),
162+
async with session.get('http://github.com/', proxy='socks5://127.0.0.1:1080',
164163
proxy_auth=auth5) as resp:
165164
if resp.status == 200:
166165
print(await resp.text())
167166
168167
# socks4 proxy
169-
async with session.get('http://github.com/', proxy=URL('socks4://127.0.0.1:1081'),
168+
async with session.get('http://github.com/', proxy='socks4://127.0.0.1:1081',
170169
proxy_auth=auth4) as resp:
171170
if resp.status == 200:
172171
print(await resp.text())
173172
174173
# http proxy
175-
async with session.get('http://github.com/', proxy=URL('http://127.0.0.1:8080'),
174+
async with session.get('http://github.com/', proxy='http://127.0.0.1:8080',
176175
proxy_auth=ba) as resp:
177176
if resp.status == 200:
178177
print(await resp.text())

0 commit comments

Comments
 (0)