Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
romis2012 committed Dec 23, 2024
1 parent c9dcc7d commit 495af9b
Showing 1 changed file with 2 additions and 21 deletions.
23 changes: 2 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ It uses [python-socks](https://github.com/romis2012/python-socks) for core proxy
## Requirements
- Python >= 3.8
- aiohttp >= 3.10.0
- python-socks[asyncio] >= 1.0.1
- python-socks[asyncio] >= 2.4.3

## Installation
```
Expand All @@ -39,7 +39,7 @@ async def fetch(url):
# port=1080,
# username='user',
# password='password',
# rdns=True
# rdns=True # default is True for socks5
# )

### proxy chaining (since ver 0.3.3)
Expand All @@ -53,25 +53,6 @@ async def fetch(url):
return await response.text()
```

#### aiohttp-socks also provides `open_connection` and `create_connection` functions:

```python
from aiohttp_socks import open_connection

async def fetch():
reader, writer = await open_connection(
proxy_url='socks5://user:[email protected]:1080',
host='check-host.net',
port=80
)
request = (b"GET /ip HTTP/1.1\r\n"
b"Host: check-host.net\r\n"
b"Connection: close\r\n\r\n")

writer.write(request)
return await reader.read(-1)
```

## Why yet another SOCKS connector for aiohttp

Unlike [aiosocksy](https://github.com/romis2012/aiosocksy), aiohttp_socks has only single point of integration with aiohttp.
Expand Down

0 comments on commit 495af9b

Please sign in to comment.