Simple proxy (SOCKS4(a), SOCKS5(h), HTTP tunnel) server built with anyio. It is used for testing python-socks, aiohttp-socks and httpx-socks packages.
- Python >= 3.7
- anyio>=3.6.1
pip install tiny-proxy
import anyio
from tiny_proxy import Socks5ProxyHandler
async def main():
handler = Socks5ProxyHandler(username='user', password='password')
listener = await anyio.create_tcp_listener(local_host='127.0.0.1', local_port=1080)
await listener.serve(handler.handle)
if __name__ == '__main__':
anyio.run(main)