All Projects → romis2012 → aiohttp-socks

romis2012 / aiohttp-socks

Licence: Apache-2.0 License
Proxy (HTTP, SOCKS) connector for aiohttp

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to aiohttp-socks

python-socks
Core proxy client (SOCKS4, SOCKS5, HTTP) functionality for Python
Stars: ✭ 40 (-72.79%)
Mutual labels:  socks5, asyncio, socks4
feedsearch-crawler
Crawl sites for RSS, Atom, and JSON feeds.
Stars: ✭ 23 (-84.35%)
Mutual labels:  aiohttp, asyncio
fbemissary
A bot framework for the Facebook Messenger platform, built on asyncio and aiohttp
Stars: ✭ 30 (-79.59%)
Mutual labels:  aiohttp, asyncio
SocksSharp
SocksSharp provides support for Socks4/4a/5 proxy servers to HttpClient
Stars: ✭ 75 (-48.98%)
Mutual labels:  socks5, socks4
stream video server
demonstrates how to create video streaming server with the help of aiohttp and opencv
Stars: ✭ 15 (-89.8%)
Mutual labels:  aiohttp, asyncio
aiohttp-mako
mako template renderer for aiohttp.web
Stars: ✭ 32 (-78.23%)
Mutual labels:  aiohttp, asyncio
glQiwiApi
The ultrarapid and multifunctional wrapper over QIWI and YooMoney
Stars: ✭ 44 (-70.07%)
Mutual labels:  aiohttp, asyncio
tomodachi
💻 Microservice library / framework using Python's asyncio event loop with full support for HTTP + WebSockets, AWS SNS+SQS, RabbitMQ / AMQP, middleware, etc. Extendable for GraphQL, protobuf, gRPC, among other technologies.
Stars: ✭ 170 (+15.65%)
Mutual labels:  aiohttp, asyncio
website
PySlackers website for invites and learning resources
Stars: ✭ 61 (-58.5%)
Mutual labels:  aiohttp, asyncio
dvhb-hybrid
A package to mix django and asyncio in one application
Stars: ✭ 45 (-69.39%)
Mutual labels:  aiohttp, asyncio
aiohttp-jwt
aiohttp middleware and helper utils for working with JSON web token.
Stars: ✭ 70 (-52.38%)
Mutual labels:  aiohttp, asyncio
asyncio-socks-server
A SOCKS proxy server implemented with the powerful python cooperative concurrency framework asyncio.
Stars: ✭ 154 (+4.76%)
Mutual labels:  socks5, asyncio
goproxy
🍉 a proxy with go,supports http,socks4/5 at the same time.
Stars: ✭ 27 (-81.63%)
Mutual labels:  socks5, socks4
pyladies-courseware
Homework/task submit and review web app · based on React and Python aiohttp
Stars: ✭ 14 (-90.48%)
Mutual labels:  aiohttp, asyncio
netunnel
A tool to create network tunnels over HTTP/S written in Python 3
Stars: ✭ 19 (-87.07%)
Mutual labels:  aiohttp, asyncio
3proxy
3proxy - tiny free proxy server
Stars: ✭ 2,493 (+1595.92%)
Mutual labels:  socks5, socks4
aiodogstatsd
An asyncio-based client for sending metrics to StatsD with support of DogStatsD extension
Stars: ✭ 26 (-82.31%)
Mutual labels:  aiohttp, asyncio
python-logi-circle
Python 3.6+ API for Logi Circle cameras
Stars: ✭ 23 (-84.35%)
Mutual labels:  aiohttp, asyncio
python3-concurrency
Python3爬虫系列的理论验证,首先研究I/O模型,分别用Python实现了blocking I/O、nonblocking I/O、I/O multiplexing各模型下的TCP服务端和客户端。然后,研究同步I/O操作(依序下载、多进程并发、多线程并发)和异步I/O(asyncio)之间的效率差别
Stars: ✭ 49 (-66.67%)
Mutual labels:  aiohttp, asyncio
ProxyGrab
Asynchronous Library made using Python and aiohttp to get proxies from multiple services!
Stars: ✭ 17 (-88.44%)
Mutual labels:  socks5, socks4

aiohttp-socks

Build Status Coverage Status PyPI version

The aiohttp-socks package provides a proxy connector for aiohttp. Supports SOCKS4(a), SOCKS5(h), HTTP (tunneling) as well as Proxy chains. It uses python-socks for core proxy functionality.

Requirements

  • Python >= 3.6
  • aiohttp >= 2.3.2
  • python-socks[asyncio] >= 1.0.1

Installation

pip install aiohttp_socks

Usage

aiohttp usage:

import aiohttp
from aiohttp_socks import ProxyType, ProxyConnector, ChainProxyConnector


async def fetch(url):
    connector = ProxyConnector.from_url('socks5://user:[email protected]:1080')
    
    ### or use ProxyConnector constructor
    # connector = ProxyConnector(
    #     proxy_type=ProxyType.SOCKS5,
    #     host='127.0.0.1',
    #     port=1080,
    #     username='user',
    #     password='password',
    #     rdns=True
    # )
    
    ### proxy chaining (since ver 0.3.3)
    # connector = ChainProxyConnector.from_urls([
    #     'socks5://user:[email protected]:1080',
    #     'socks4://127.0.0.1:1081',
    #     'http://user:[email protected]:3128',
    # ])
    async with aiohttp.ClientSession(connector=connector) as session:
        async with session.get(url) as response:
            return await response.text()

aiohttp-socks also provides open_connection and create_connection functions:

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, aiohttp_socks has only single point of integration with aiohttp. This makes it easier to maintain compatibility with new aiohttp versions.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].