python-socks 2.6.0__tar.gz → 2.7.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_socks-2.6.0/python_socks.egg-info → python_socks-2.7.0}/PKG-INFO +2 -2
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/_errors.py +1 -1
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/_version.py +1 -1
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/async_/_proxy_chain.py +8 -2
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/async_/anyio/_chain.py +6 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/async_/anyio/_connect.py +2 -1
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/async_/anyio/_proxy.py +11 -2
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/async_/anyio/v2/_chain.py +6 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/async_/anyio/v2/_connect.py +2 -1
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/async_/anyio/v2/_proxy.py +8 -5
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/async_/asyncio/_connect.py +1 -1
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/async_/asyncio/_proxy.py +20 -32
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/async_/asyncio/v2/_chain.py +6 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/async_/asyncio/v2/_connect.py +1 -1
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/async_/asyncio/v2/_proxy.py +8 -5
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/async_/asyncio/v2/_stream.py +5 -45
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/async_/curio/_proxy.py +12 -1
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/async_/trio/_proxy.py +13 -4
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/async_/trio/v2/_chain.py +6 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/async_/trio/v2/_connect.py +2 -2
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/async_/trio/v2/_proxy.py +7 -2
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/sync/_chain.py +8 -5
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/sync/_connect.py +1 -1
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/sync/_proxy.py +11 -4
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/sync/v2/_connect.py +1 -1
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/sync/v2/_proxy.py +6 -3
- {python_socks-2.6.0 → python_socks-2.7.0/python_socks.egg-info}/PKG-INFO +2 -2
- {python_socks-2.6.0 → python_socks-2.7.0}/LICENSE.txt +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/MANIFEST.in +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/README.md +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/pyproject.toml +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/__init__.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/_abc.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/_connectors/__init__.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/_connectors/abc.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/_connectors/factory_async.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/_connectors/factory_sync.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/_connectors/http_async.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/_connectors/http_sync.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/_connectors/socks4_async.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/_connectors/socks4_sync.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/_connectors/socks5_async.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/_connectors/socks5_sync.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/_helpers.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/_protocols/__init__.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/_protocols/errors.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/_protocols/http.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/_protocols/socks4.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/_protocols/socks5.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/_types.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/async_/__init__.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/async_/anyio/__init__.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/async_/anyio/_resolver.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/async_/anyio/_stream.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/async_/anyio/v2/__init__.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/async_/anyio/v2/_stream.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/async_/asyncio/__init__.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/async_/asyncio/_resolver.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/async_/asyncio/_stream.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/async_/asyncio/v2/__init__.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/async_/curio/__init__.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/async_/curio/_connect.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/async_/curio/_resolver.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/async_/curio/_stream.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/async_/trio/__init__.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/async_/trio/_connect.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/async_/trio/_resolver.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/async_/trio/_stream.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/async_/trio/v2/__init__.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/async_/trio/v2/_stream.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/py.typed +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/sync/__init__.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/sync/_resolver.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/sync/_stream.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/sync/v2/__init__.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/sync/v2/_chain.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/sync/v2/_ssl_transport.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks/sync/v2/_stream.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks.egg-info/SOURCES.txt +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks.egg-info/dependency_links.txt +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks.egg-info/requires.txt +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/python_socks.egg-info/top_level.txt +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/setup.cfg +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__init__.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/__init__.cpython-310.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/__init__.cpython-311.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/__init__.cpython-312.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/__init__.cpython-313.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/__init__.cpython-36.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/__init__.cpython-37.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/__init__.cpython-38.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/__init__.cpython-39.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/config.cpython-310.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/config.cpython-311.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/config.cpython-312.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/config.cpython-313.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/config.cpython-36.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/config.cpython-37.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/config.cpython-38.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/config.cpython-39.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/conftest.cpython-310-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/conftest.cpython-311-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/conftest.cpython-312-pytest-8.0.2.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/conftest.cpython-313-pytest-8.0.2.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/conftest.cpython-36-pytest-6.2.5.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/conftest.cpython-36-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/conftest.cpython-37-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/conftest.cpython-38-pytest-8.0.2.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/conftest.cpython-39-pytest-6.2.2.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/conftest.cpython-39-pytest-6.2.5.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/conftest.cpython-39-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/http_app.cpython-310.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/http_app.cpython-311.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/http_app.cpython-312.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/http_app.cpython-313.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/http_app.cpython-36.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/http_app.cpython-37.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/http_app.cpython-38.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/http_app.cpython-39.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/http_server.cpython-310.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/http_server.cpython-311.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/http_server.cpython-312.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/http_server.cpython-313.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/http_server.cpython-36.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/http_server.cpython-37.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/http_server.cpython-38.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/http_server.cpython-39.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/mocks.cpython-310.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/mocks.cpython-311.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/mocks.cpython-312.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/mocks.cpython-313.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/mocks.cpython-36.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/mocks.cpython-37.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/mocks.cpython-38.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/mocks.cpython-39.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/proxy_server.cpython-310.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/proxy_server.cpython-311.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/proxy_server.cpython-312.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/proxy_server.cpython-313.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/proxy_server.cpython-37.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/proxy_server.cpython-38.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/proxy_server.cpython-39.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_core_socks_async_aio.cpython-36-pytest-6.2.5.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_core_socks_async_aio.cpython-39-pytest-6.2.2.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_core_socks_async_aio.cpython-39-pytest-6.2.5.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_core_socks_async_aio_ext.cpython-36-pytest-6.2.5.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_core_socks_async_aio_ext.cpython-39-pytest-6.2.2.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_core_socks_async_aio_ext.cpython-39-pytest-6.2.5.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_core_socks_async_curio.cpython-36-pytest-6.2.5.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_core_socks_async_curio.cpython-39-pytest-6.2.2.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_core_socks_async_curio.cpython-39-pytest-6.2.5.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_core_socks_async_trio.cpython-36-pytest-6.2.5.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_core_socks_async_trio.cpython-39-pytest-6.2.2.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_core_socks_async_trio.cpython-39-pytest-6.2.5.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_core_socks_sync.cpython-36-pytest-6.2.5.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_core_socks_sync.cpython-39-pytest-6.2.2.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_core_socks_sync.cpython-39-pytest-6.2.5.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_misc.cpython-310-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_misc.cpython-311-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_misc.cpython-312-pytest-8.0.2.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_misc.cpython-313-pytest-8.0.2.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_misc.cpython-36-pytest-6.2.5.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_misc.cpython-36-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_misc.cpython-37-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_misc.cpython-38-pytest-8.0.2.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_misc.cpython-39-pytest-6.2.2.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_misc.cpython-39-pytest-6.2.5.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_misc.cpython-39-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_aio.cpython-310-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_aio.cpython-311-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_aio.cpython-312-pytest-8.0.2.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_aio.cpython-313-pytest-8.0.2.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_aio.cpython-36-pytest-6.2.5.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_aio.cpython-36-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_aio.cpython-37-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_aio.cpython-38-pytest-8.0.2.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_aio.cpython-39-pytest-6.2.5.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_aio.cpython-39-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_aio_ext.cpython-39-pytest-6.2.5.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_aio_v2.cpython-310-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_aio_v2.cpython-311-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_aio_v2.cpython-312-pytest-8.0.2.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_aio_v2.cpython-313-pytest-8.0.2.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_aio_v2.cpython-36-pytest-6.2.5.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_aio_v2.cpython-36-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_aio_v2.cpython-37-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_aio_v2.cpython-38-pytest-8.0.2.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_aio_v2.cpython-39-pytest-6.2.5.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_aio_v2.cpython-39-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_anyio.cpython-310-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_anyio.cpython-311-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_anyio.cpython-312-pytest-8.0.2.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_anyio.cpython-313-pytest-8.0.2.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_anyio.cpython-36-pytest-6.2.5.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_anyio.cpython-36-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_anyio.cpython-37-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_anyio.cpython-38-pytest-8.0.2.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_anyio.cpython-39-pytest-6.2.5.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_anyio.cpython-39-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_anyio_v2.cpython-310-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_anyio_v2.cpython-311-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_anyio_v2.cpython-312-pytest-8.0.2.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_anyio_v2.cpython-313-pytest-8.0.2.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_anyio_v2.cpython-37-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_anyio_v2.cpython-38-pytest-8.0.2.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_curio.cpython-310-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_curio.cpython-311-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_curio.cpython-312-pytest-8.0.2.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_curio.cpython-313-pytest-8.0.2.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_curio.cpython-36-pytest-6.2.5.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_curio.cpython-36-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_curio.cpython-37-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_curio.cpython-38-pytest-8.0.2.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_curio.cpython-39-pytest-6.2.5.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_curio.cpython-39-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_trio.cpython-310-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_trio.cpython-311-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_trio.cpython-312-pytest-8.0.2.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_trio.cpython-313-pytest-8.0.2.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_trio.cpython-36-pytest-6.2.5.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_trio.cpython-36-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_trio.cpython-37-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_trio.cpython-38-pytest-8.0.2.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_trio.cpython-39-pytest-6.2.5.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_trio.cpython-39-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_trio_v2.cpython-310-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_trio_v2.cpython-311-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_trio_v2.cpython-312-pytest-8.0.2.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_trio_v2.cpython-313-pytest-8.0.2.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_trio_v2.cpython-36-pytest-6.2.5.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_trio_v2.cpython-36-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_trio_v2.cpython-37-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_trio_v2.cpython-38-pytest-8.0.2.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_trio_v2.cpython-39-pytest-6.2.5.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_async_trio_v2.cpython-39-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_sync.cpython-310-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_sync.cpython-311-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_sync.cpython-312-pytest-8.0.2.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_sync.cpython-313-pytest-8.0.2.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_sync.cpython-36-pytest-6.2.5.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_sync.cpython-36-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_sync.cpython-37-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_sync.cpython-38-pytest-8.0.2.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_sync.cpython-39-pytest-6.2.5.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_sync.cpython-39-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_sync_v2.cpython-310-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_sync_v2.cpython-311-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_sync_v2.cpython-312-pytest-8.0.2.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_sync_v2.cpython-313-pytest-8.0.2.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_sync_v2.cpython-36-pytest-6.2.5.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_sync_v2.cpython-36-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_sync_v2.cpython-37-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_sync_v2.cpython-38-pytest-8.0.2.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_sync_v2.cpython-39-pytest-6.2.5.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_proxy_sync_v2.cpython-39-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_resolvers.cpython-310-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_resolvers.cpython-311-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_resolvers.cpython-312-pytest-8.0.2.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_resolvers.cpython-313-pytest-8.0.2.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_resolvers.cpython-36-pytest-6.2.5.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_resolvers.cpython-36-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_resolvers.cpython-37-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_resolvers.cpython-38-pytest-8.0.2.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_resolvers.cpython-39-pytest-6.2.2.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_resolvers.cpython-39-pytest-6.2.5.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/test_resolvers.cpython-39-pytest-7.0.1.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/utils.cpython-310.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/utils.cpython-311.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/utils.cpython-312.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/utils.cpython-313.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/utils.cpython-36.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/utils.cpython-37.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/utils.cpython-38.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/__pycache__/utils.cpython-39.pyc +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/config.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/conftest.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/http_app.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/http_server.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/mocks.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/proxy_server.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/test_misc.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/test_proxy_async_aio.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/test_proxy_async_aio_v2.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/test_proxy_async_anyio.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/test_proxy_async_anyio_v2.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/test_proxy_async_curio.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/test_proxy_async_trio.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/test_proxy_async_trio_v2.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/test_proxy_sync.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/test_proxy_sync_v2.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/test_resolvers.py +0 -0
- {python_socks-2.6.0 → python_socks-2.7.0}/tests/utils.py +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
__title__ = 'python-socks'
|
|
2
|
-
__version__ = '2.
|
|
2
|
+
__version__ = '2.7.0'
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
from typing import Iterable
|
|
2
|
+
import warnings
|
|
2
3
|
|
|
3
4
|
|
|
4
5
|
class ProxyChain:
|
|
5
6
|
def __init__(self, proxies: Iterable):
|
|
7
|
+
warnings.warn(
|
|
8
|
+
'This implementation of ProxyChain is deprecated and will be removed in the future',
|
|
9
|
+
DeprecationWarning,
|
|
10
|
+
stacklevel=2,
|
|
11
|
+
)
|
|
6
12
|
self._proxies = proxies
|
|
7
13
|
|
|
8
14
|
async def connect(self, dest_host, dest_port, timeout=None):
|
|
@@ -15,14 +21,14 @@ class ProxyChain:
|
|
|
15
21
|
dest_host=proxies[i + 1].proxy_host,
|
|
16
22
|
dest_port=proxies[i + 1].proxy_port,
|
|
17
23
|
timeout=timeout,
|
|
18
|
-
_socket=curr_socket
|
|
24
|
+
_socket=curr_socket,
|
|
19
25
|
)
|
|
20
26
|
|
|
21
27
|
curr_socket = await proxies[length].connect(
|
|
22
28
|
dest_host=dest_host,
|
|
23
29
|
dest_port=dest_port,
|
|
24
30
|
timeout=timeout,
|
|
25
|
-
_socket=curr_socket
|
|
31
|
+
_socket=curr_socket,
|
|
26
32
|
)
|
|
27
33
|
|
|
28
34
|
return curr_socket
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
from typing import Iterable
|
|
2
|
+
import warnings
|
|
2
3
|
from ._proxy import AnyioProxy
|
|
3
4
|
|
|
4
5
|
|
|
5
6
|
class ProxyChain:
|
|
6
7
|
def __init__(self, proxies: Iterable[AnyioProxy]):
|
|
8
|
+
warnings.warn(
|
|
9
|
+
'This implementation of ProxyChain is deprecated and will be removed in the future',
|
|
10
|
+
DeprecationWarning,
|
|
11
|
+
stacklevel=2,
|
|
12
|
+
)
|
|
7
13
|
self._proxies = proxies
|
|
8
14
|
|
|
9
15
|
async def connect(
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from typing import Optional
|
|
1
2
|
import anyio
|
|
2
3
|
import anyio.abc
|
|
3
4
|
|
|
@@ -5,7 +6,7 @@ import anyio.abc
|
|
|
5
6
|
async def connect_tcp(
|
|
6
7
|
host: str,
|
|
7
8
|
port: int,
|
|
8
|
-
local_host: str = None,
|
|
9
|
+
local_host: Optional[str] = None,
|
|
9
10
|
) -> anyio.abc.SocketStream:
|
|
10
11
|
|
|
11
12
|
return await anyio.connect_tcp(
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import ssl
|
|
2
2
|
from typing import Any, Optional
|
|
3
|
+
import warnings
|
|
3
4
|
|
|
4
5
|
import anyio
|
|
5
6
|
|
|
@@ -52,7 +53,14 @@ class AnyioProxy:
|
|
|
52
53
|
timeout = DEFAULT_TIMEOUT
|
|
53
54
|
|
|
54
55
|
_stream = kwargs.get('_stream')
|
|
55
|
-
|
|
56
|
+
if _stream is not None:
|
|
57
|
+
warnings.warn(
|
|
58
|
+
"The '_stream' argument is deprecated and will be removed in the future",
|
|
59
|
+
DeprecationWarning,
|
|
60
|
+
stacklevel=2,
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
local_host = kwargs.get('local_host')
|
|
56
64
|
try:
|
|
57
65
|
with anyio.fail_after(timeout):
|
|
58
66
|
if _stream is None:
|
|
@@ -61,6 +69,7 @@ class AnyioProxy:
|
|
|
61
69
|
await connect_tcp(
|
|
62
70
|
host=self._proxy_host,
|
|
63
71
|
port=self._proxy_port,
|
|
72
|
+
local_host=local_host,
|
|
64
73
|
)
|
|
65
74
|
)
|
|
66
75
|
except OSError as e:
|
|
@@ -123,6 +132,6 @@ class AnyioProxy:
|
|
|
123
132
|
return cls(*args, **kwargs)
|
|
124
133
|
|
|
125
134
|
@classmethod
|
|
126
|
-
def from_url(cls, url: str, **kwargs):
|
|
135
|
+
def from_url(cls, url: str, **kwargs) -> 'AnyioProxy':
|
|
127
136
|
url_args = parse_proxy_url(url)
|
|
128
137
|
return cls(*url_args, **kwargs)
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
from typing import Sequence
|
|
2
|
+
import warnings
|
|
2
3
|
from ._proxy import AnyioProxy
|
|
3
4
|
|
|
4
5
|
|
|
5
6
|
class ProxyChain:
|
|
6
7
|
def __init__(self, proxies: Sequence[AnyioProxy]):
|
|
8
|
+
warnings.warn(
|
|
9
|
+
'This implementation of ProxyChain is deprecated and will be removed in the future',
|
|
10
|
+
DeprecationWarning,
|
|
11
|
+
stacklevel=2,
|
|
12
|
+
)
|
|
7
13
|
self._proxies = proxies
|
|
8
14
|
|
|
9
15
|
async def connect(
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from typing import Optional
|
|
1
2
|
import anyio
|
|
2
3
|
import anyio.abc
|
|
3
4
|
from ._stream import AnyioSocketStream
|
|
@@ -6,7 +7,7 @@ from ._stream import AnyioSocketStream
|
|
|
6
7
|
async def connect_tcp(
|
|
7
8
|
host: str,
|
|
8
9
|
port: int,
|
|
9
|
-
local_host: str = None,
|
|
10
|
+
local_host: Optional[str] = None,
|
|
10
11
|
) -> AnyioSocketStream:
|
|
11
12
|
s = await anyio.connect_tcp(
|
|
12
13
|
remote_host=host,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import ssl
|
|
2
|
-
from typing import Optional
|
|
2
|
+
from typing import Any, Optional
|
|
3
3
|
|
|
4
4
|
import anyio
|
|
5
5
|
|
|
@@ -47,33 +47,36 @@ class AnyioProxy:
|
|
|
47
47
|
dest_port: int,
|
|
48
48
|
dest_ssl: Optional[ssl.SSLContext] = None,
|
|
49
49
|
timeout: Optional[float] = None,
|
|
50
|
+
**kwargs: Any,
|
|
50
51
|
) -> AnyioSocketStream:
|
|
51
52
|
if timeout is None:
|
|
52
53
|
timeout = DEFAULT_TIMEOUT
|
|
53
54
|
|
|
55
|
+
local_host = kwargs.get('local_host')
|
|
54
56
|
try:
|
|
55
57
|
with anyio.fail_after(timeout):
|
|
56
58
|
return await self._connect(
|
|
57
59
|
dest_host=dest_host,
|
|
58
60
|
dest_port=dest_port,
|
|
59
61
|
dest_ssl=dest_ssl,
|
|
62
|
+
local_host=local_host,
|
|
60
63
|
)
|
|
61
64
|
except TimeoutError as e:
|
|
62
|
-
raise ProxyTimeoutError(
|
|
63
|
-
'Proxy connection timed out: {}'.format(timeout)
|
|
64
|
-
) from e
|
|
65
|
+
raise ProxyTimeoutError('Proxy connection timed out: {}'.format(timeout)) from e
|
|
65
66
|
|
|
66
67
|
async def _connect(
|
|
67
68
|
self,
|
|
68
69
|
dest_host: str,
|
|
69
70
|
dest_port: int,
|
|
70
71
|
dest_ssl: Optional[ssl.SSLContext] = None,
|
|
72
|
+
local_host: Optional[str] = None,
|
|
71
73
|
) -> AnyioSocketStream:
|
|
72
74
|
if self._forward is None:
|
|
73
75
|
try:
|
|
74
76
|
stream = await connect_tcp(
|
|
75
77
|
host=self._proxy_host,
|
|
76
78
|
port=self._proxy_port,
|
|
79
|
+
local_host=local_host,
|
|
77
80
|
)
|
|
78
81
|
except OSError as e:
|
|
79
82
|
raise ProxyConnectionError(
|
|
@@ -127,6 +130,6 @@ class AnyioProxy:
|
|
|
127
130
|
return cls(*args, **kwargs)
|
|
128
131
|
|
|
129
132
|
@classmethod
|
|
130
|
-
def from_url(cls, url: str, **kwargs):
|
|
133
|
+
def from_url(cls, url: str, **kwargs) -> 'AnyioProxy':
|
|
131
134
|
url_args = parse_proxy_url(url)
|
|
132
135
|
return cls(*url_args, **kwargs)
|
|
@@ -23,7 +23,7 @@ async def connect_tcp(
|
|
|
23
23
|
if is_ipv6_address(host):
|
|
24
24
|
address = (host, port, 0, 0) # to fix OSError: [WinError 10022]
|
|
25
25
|
else:
|
|
26
|
-
address = (host, port)
|
|
26
|
+
address = (host, port) # type: ignore[assignment]
|
|
27
27
|
|
|
28
28
|
await loop.sock_connect(sock=sock, address=address)
|
|
29
29
|
return sock
|
|
@@ -2,6 +2,7 @@ import asyncio
|
|
|
2
2
|
import socket
|
|
3
3
|
import sys
|
|
4
4
|
from typing import Any, Optional
|
|
5
|
+
import warnings
|
|
5
6
|
|
|
6
7
|
from ..._types import ProxyType
|
|
7
8
|
from ..._helpers import parse_proxy_url
|
|
@@ -58,23 +59,39 @@ class AsyncioProxy:
|
|
|
58
59
|
timeout = DEFAULT_TIMEOUT
|
|
59
60
|
|
|
60
61
|
_socket = kwargs.get('_socket')
|
|
62
|
+
if _socket is not None:
|
|
63
|
+
warnings.warn(
|
|
64
|
+
"The '_socket' argument is deprecated and will be removed in the future",
|
|
65
|
+
DeprecationWarning,
|
|
66
|
+
stacklevel=2,
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
local_addr = kwargs.get('local_addr')
|
|
61
70
|
try:
|
|
62
71
|
async with async_timeout.timeout(timeout):
|
|
63
72
|
return await self._connect(
|
|
64
73
|
dest_host=dest_host,
|
|
65
74
|
dest_port=dest_port,
|
|
66
75
|
_socket=_socket,
|
|
76
|
+
local_addr=local_addr,
|
|
67
77
|
)
|
|
68
78
|
except asyncio.TimeoutError as e:
|
|
69
79
|
raise ProxyTimeoutError(f'Proxy connection timed out: {timeout}') from e
|
|
70
80
|
|
|
71
|
-
async def _connect(
|
|
81
|
+
async def _connect(
|
|
82
|
+
self,
|
|
83
|
+
dest_host,
|
|
84
|
+
dest_port,
|
|
85
|
+
_socket=None,
|
|
86
|
+
local_addr=None,
|
|
87
|
+
) -> socket.socket:
|
|
72
88
|
if _socket is None:
|
|
73
89
|
try:
|
|
74
90
|
_socket = await connect_tcp(
|
|
75
91
|
host=self._proxy_host,
|
|
76
92
|
port=self._proxy_port,
|
|
77
93
|
loop=self._loop,
|
|
94
|
+
local_addr=local_addr,
|
|
78
95
|
)
|
|
79
96
|
except OSError as e:
|
|
80
97
|
msg = 'Could not connect to proxy {}:{} [{}]'.format(
|
|
@@ -101,42 +118,13 @@ class AsyncioProxy:
|
|
|
101
118
|
)
|
|
102
119
|
|
|
103
120
|
return _socket
|
|
104
|
-
except asyncio.CancelledError: # pragma: no cover
|
|
105
|
-
# https://bugs.python.org/issue30064
|
|
106
|
-
# https://bugs.python.org/issue34795
|
|
107
|
-
if self._can_be_closed_safely():
|
|
108
|
-
await stream.close()
|
|
109
|
-
raise
|
|
110
121
|
except ReplyError as e:
|
|
111
122
|
await stream.close()
|
|
112
123
|
raise ProxyError(e, error_code=e.error_code)
|
|
113
|
-
except Exception: # pragma: no cover
|
|
124
|
+
except (asyncio.CancelledError, Exception): # pragma: no cover
|
|
114
125
|
await stream.close()
|
|
115
126
|
raise
|
|
116
127
|
|
|
117
|
-
def _can_be_closed_safely(self): # pragma: no cover
|
|
118
|
-
def is_proactor_event_loop():
|
|
119
|
-
try:
|
|
120
|
-
# pylint:disable-next=import-outside-toplevel
|
|
121
|
-
from asyncio import ProactorEventLoop
|
|
122
|
-
except ImportError:
|
|
123
|
-
return False
|
|
124
|
-
return isinstance(self._loop, ProactorEventLoop)
|
|
125
|
-
|
|
126
|
-
def is_uvloop_event_loop():
|
|
127
|
-
try:
|
|
128
|
-
# pylint:disable-next=import-outside-toplevel
|
|
129
|
-
from uvloop import Loop # type:ignore[import-not-found]
|
|
130
|
-
except ImportError:
|
|
131
|
-
return False
|
|
132
|
-
return isinstance(self._loop, Loop)
|
|
133
|
-
|
|
134
|
-
return (
|
|
135
|
-
sys.version_info[:2] >= (3, 8)
|
|
136
|
-
or is_proactor_event_loop()
|
|
137
|
-
or is_uvloop_event_loop()
|
|
138
|
-
)
|
|
139
|
-
|
|
140
128
|
@property
|
|
141
129
|
def proxy_host(self):
|
|
142
130
|
return self._proxy_host
|
|
@@ -150,6 +138,6 @@ class AsyncioProxy:
|
|
|
150
138
|
return cls(*args, **kwargs)
|
|
151
139
|
|
|
152
140
|
@classmethod
|
|
153
|
-
def from_url(cls, url: str, **kwargs):
|
|
141
|
+
def from_url(cls, url: str, **kwargs) -> 'AsyncioProxy':
|
|
154
142
|
url_args = parse_proxy_url(url)
|
|
155
143
|
return cls(*url_args, **kwargs)
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
from typing import Sequence
|
|
2
|
+
import warnings
|
|
2
3
|
from ._proxy import AsyncioProxy
|
|
3
4
|
|
|
4
5
|
|
|
5
6
|
class ProxyChain:
|
|
6
7
|
def __init__(self, proxies: Sequence[AsyncioProxy]):
|
|
8
|
+
warnings.warn(
|
|
9
|
+
'This implementation of ProxyChain is deprecated and will be removed in the future',
|
|
10
|
+
DeprecationWarning,
|
|
11
|
+
stacklevel=2,
|
|
12
|
+
)
|
|
7
13
|
self._proxies = proxies
|
|
8
14
|
|
|
9
15
|
async def connect(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import asyncio
|
|
2
2
|
import ssl
|
|
3
|
-
from typing import Optional
|
|
3
|
+
from typing import Any, Optional, Tuple
|
|
4
4
|
import warnings
|
|
5
5
|
import sys
|
|
6
6
|
|
|
@@ -68,27 +68,29 @@ class AsyncioProxy:
|
|
|
68
68
|
dest_port: int,
|
|
69
69
|
dest_ssl: Optional[ssl.SSLContext] = None,
|
|
70
70
|
timeout: Optional[float] = None,
|
|
71
|
+
**kwargs: Any,
|
|
71
72
|
) -> AsyncioSocketStream:
|
|
72
73
|
if timeout is None:
|
|
73
74
|
timeout = DEFAULT_TIMEOUT
|
|
74
75
|
|
|
76
|
+
local_addr = kwargs.get('local_addr')
|
|
75
77
|
try:
|
|
76
78
|
async with async_timeout.timeout(timeout):
|
|
77
79
|
return await self._connect(
|
|
78
80
|
dest_host=dest_host,
|
|
79
81
|
dest_port=dest_port,
|
|
80
82
|
dest_ssl=dest_ssl,
|
|
83
|
+
local_addr=local_addr,
|
|
81
84
|
)
|
|
82
85
|
except asyncio.TimeoutError as e:
|
|
83
|
-
raise ProxyTimeoutError(
|
|
84
|
-
'Proxy connection timed out: {}'.format(timeout)
|
|
85
|
-
) from e
|
|
86
|
+
raise ProxyTimeoutError('Proxy connection timed out: {}'.format(timeout)) from e
|
|
86
87
|
|
|
87
88
|
async def _connect(
|
|
88
89
|
self,
|
|
89
90
|
dest_host: str,
|
|
90
91
|
dest_port: int,
|
|
91
92
|
dest_ssl: Optional[ssl.SSLContext] = None,
|
|
93
|
+
local_addr: Optional[Tuple[str, int]] = None,
|
|
92
94
|
) -> AsyncioSocketStream:
|
|
93
95
|
if self._forward is None:
|
|
94
96
|
try:
|
|
@@ -96,6 +98,7 @@ class AsyncioProxy:
|
|
|
96
98
|
host=self._proxy_host,
|
|
97
99
|
port=self._proxy_port,
|
|
98
100
|
loop=self._loop,
|
|
101
|
+
local_addr=local_addr,
|
|
99
102
|
)
|
|
100
103
|
except OSError as e:
|
|
101
104
|
raise ProxyConnectionError(
|
|
@@ -149,6 +152,6 @@ class AsyncioProxy:
|
|
|
149
152
|
return cls(*args, **kwargs)
|
|
150
153
|
|
|
151
154
|
@classmethod
|
|
152
|
-
def from_url(cls, url: str, **kwargs):
|
|
155
|
+
def from_url(cls, url: str, **kwargs) -> 'AsyncioProxy':
|
|
153
156
|
url_args = parse_proxy_url(url)
|
|
154
157
|
return cls(*url_args, **kwargs)
|
|
@@ -6,48 +6,10 @@ from .... import _abc as abc
|
|
|
6
6
|
DEFAULT_RECEIVE_SIZE = 65536
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
# noinspection PyUnusedLocal
|
|
10
|
-
async def backport_start_tls(
|
|
11
|
-
transport,
|
|
12
|
-
protocol,
|
|
13
|
-
ssl_context,
|
|
14
|
-
*,
|
|
15
|
-
server_side=False,
|
|
16
|
-
server_hostname=None,
|
|
17
|
-
ssl_handshake_timeout=None,
|
|
18
|
-
): # pragma: no cover
|
|
19
|
-
"""
|
|
20
|
-
Python 3.6 asyncio doesn't have a start_tls() method on the loop,
|
|
21
|
-
so we use this function in place of the loop's start_tls() method.
|
|
22
|
-
Adapted from this comment:
|
|
23
|
-
https://github.com/urllib3/urllib3/issues/1323#issuecomment-362494839
|
|
24
|
-
"""
|
|
25
|
-
import asyncio.sslproto
|
|
26
|
-
|
|
27
|
-
loop = asyncio.get_event_loop()
|
|
28
|
-
waiter = loop.create_future()
|
|
29
|
-
ssl_protocol = asyncio.sslproto.SSLProtocol(
|
|
30
|
-
loop,
|
|
31
|
-
protocol,
|
|
32
|
-
ssl_context,
|
|
33
|
-
waiter,
|
|
34
|
-
server_side=False,
|
|
35
|
-
server_hostname=server_hostname,
|
|
36
|
-
call_connection_made=False,
|
|
37
|
-
)
|
|
38
|
-
|
|
39
|
-
transport.set_protocol(ssl_protocol)
|
|
40
|
-
loop.call_soon(ssl_protocol.connection_made, transport)
|
|
41
|
-
loop.call_soon(transport.resume_reading) # type: ignore
|
|
42
|
-
|
|
43
|
-
await waiter
|
|
44
|
-
return ssl_protocol._app_transport # noqa
|
|
45
|
-
|
|
46
|
-
|
|
47
9
|
class AsyncioSocketStream(abc.AsyncSocketStream):
|
|
48
|
-
_loop: asyncio.AbstractEventLoop
|
|
49
|
-
_reader: asyncio.StreamReader
|
|
50
|
-
_writer: asyncio.StreamWriter
|
|
10
|
+
_loop: asyncio.AbstractEventLoop
|
|
11
|
+
_reader: asyncio.StreamReader
|
|
12
|
+
_writer: asyncio.StreamWriter
|
|
51
13
|
|
|
52
14
|
def __init__(
|
|
53
15
|
self,
|
|
@@ -86,9 +48,7 @@ class AsyncioSocketStream(abc.AsyncSocketStream):
|
|
|
86
48
|
reader = asyncio.StreamReader()
|
|
87
49
|
protocol = asyncio.StreamReaderProtocol(reader)
|
|
88
50
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
transport = await loop_start_tls(
|
|
51
|
+
transport: asyncio.Transport = await self._loop.start_tls(
|
|
92
52
|
self._writer.transport, # type: ignore
|
|
93
53
|
protocol,
|
|
94
54
|
ssl_context,
|
|
@@ -115,7 +75,7 @@ class AsyncioSocketStream(abc.AsyncSocketStream):
|
|
|
115
75
|
# When we return a new SocketStream with new StreamReader/StreamWriter instances
|
|
116
76
|
# we need to keep references to the old StreamReader/StreamWriter so that they
|
|
117
77
|
# are not garbage collected and closed while we're still using them.
|
|
118
|
-
stream._inner = self # type: ignore
|
|
78
|
+
stream._inner = self # type: ignore # pylint:disable=W0212,W0201
|
|
119
79
|
return stream
|
|
120
80
|
|
|
121
81
|
async def close(self):
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from typing import Any, Optional
|
|
2
|
+
import warnings
|
|
2
3
|
import curio
|
|
3
4
|
import curio.io
|
|
4
5
|
|
|
@@ -47,7 +48,14 @@ class CurioProxy:
|
|
|
47
48
|
timeout = DEFAULT_TIMEOUT
|
|
48
49
|
|
|
49
50
|
_socket = kwargs.get('_socket')
|
|
51
|
+
if _socket is not None:
|
|
52
|
+
warnings.warn(
|
|
53
|
+
"The '_socket' argument is deprecated and will be removed in the future",
|
|
54
|
+
DeprecationWarning,
|
|
55
|
+
stacklevel=2,
|
|
56
|
+
)
|
|
50
57
|
|
|
58
|
+
local_addr = kwargs.get('local_addr')
|
|
51
59
|
try:
|
|
52
60
|
return await curio.timeout_after(
|
|
53
61
|
timeout,
|
|
@@ -55,6 +63,7 @@ class CurioProxy:
|
|
|
55
63
|
dest_host,
|
|
56
64
|
dest_port,
|
|
57
65
|
_socket,
|
|
66
|
+
local_addr,
|
|
58
67
|
)
|
|
59
68
|
except curio.TaskTimeout as e:
|
|
60
69
|
raise ProxyTimeoutError(f'Proxy connection timed out: {timeout}') from e
|
|
@@ -64,12 +73,14 @@ class CurioProxy:
|
|
|
64
73
|
dest_host: str,
|
|
65
74
|
dest_port: int,
|
|
66
75
|
_socket=None,
|
|
76
|
+
local_addr=None,
|
|
67
77
|
):
|
|
68
78
|
if _socket is None:
|
|
69
79
|
try:
|
|
70
80
|
_socket = await connect_tcp(
|
|
71
81
|
host=self._proxy_host,
|
|
72
82
|
port=self._proxy_port,
|
|
83
|
+
local_addr=local_addr,
|
|
73
84
|
)
|
|
74
85
|
except OSError as e:
|
|
75
86
|
msg = 'Could not connect to proxy {}:{} [{}]'.format(
|
|
@@ -116,6 +127,6 @@ class CurioProxy:
|
|
|
116
127
|
return cls(*args, **kwargs)
|
|
117
128
|
|
|
118
129
|
@classmethod
|
|
119
|
-
def from_url(cls, url: str, **kwargs):
|
|
130
|
+
def from_url(cls, url: str, **kwargs) -> 'CurioProxy':
|
|
120
131
|
url_args = parse_proxy_url(url)
|
|
121
132
|
return cls(*url_args, **kwargs)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from typing import Any, Optional
|
|
2
|
+
import warnings
|
|
2
3
|
import trio
|
|
3
4
|
|
|
4
5
|
from ..._types import ProxyType
|
|
@@ -46,30 +47,38 @@ class TrioProxy:
|
|
|
46
47
|
timeout = DEFAULT_TIMEOUT
|
|
47
48
|
|
|
48
49
|
_socket = kwargs.get('_socket')
|
|
50
|
+
if _socket is not None:
|
|
51
|
+
warnings.warn(
|
|
52
|
+
"The '_socket' argument is deprecated and will be removed in the future",
|
|
53
|
+
DeprecationWarning,
|
|
54
|
+
stacklevel=2,
|
|
55
|
+
)
|
|
49
56
|
|
|
57
|
+
local_addr = kwargs.get('local_addr')
|
|
50
58
|
try:
|
|
51
59
|
with trio.fail_after(timeout):
|
|
52
60
|
return await self._connect(
|
|
53
61
|
dest_host=dest_host,
|
|
54
62
|
dest_port=dest_port,
|
|
55
63
|
_socket=_socket,
|
|
64
|
+
local_addr=local_addr,
|
|
56
65
|
)
|
|
57
66
|
except trio.TooSlowError as e:
|
|
58
|
-
raise ProxyTimeoutError(
|
|
59
|
-
'Proxy connection timed out: {}'.format(timeout)
|
|
60
|
-
) from e
|
|
67
|
+
raise ProxyTimeoutError('Proxy connection timed out: {}'.format(timeout)) from e
|
|
61
68
|
|
|
62
69
|
async def _connect(
|
|
63
70
|
self,
|
|
64
71
|
dest_host: str,
|
|
65
72
|
dest_port: int,
|
|
66
73
|
_socket=None,
|
|
74
|
+
local_addr=None,
|
|
67
75
|
) -> trio.socket.SocketType:
|
|
68
76
|
if _socket is None:
|
|
69
77
|
try:
|
|
70
78
|
_socket = await connect_tcp(
|
|
71
79
|
host=self._proxy_host,
|
|
72
80
|
port=self._proxy_port,
|
|
81
|
+
local_addr=local_addr,
|
|
73
82
|
)
|
|
74
83
|
except OSError as e:
|
|
75
84
|
msg = 'Could not connect to proxy {}:{} [{}]'.format(
|
|
@@ -117,6 +126,6 @@ class TrioProxy:
|
|
|
117
126
|
return cls(*args, **kwargs)
|
|
118
127
|
|
|
119
128
|
@classmethod
|
|
120
|
-
def from_url(cls, url: str, **kwargs):
|
|
129
|
+
def from_url(cls, url: str, **kwargs) -> 'TrioProxy':
|
|
121
130
|
url_args = parse_proxy_url(url)
|
|
122
131
|
return cls(*url_args, **kwargs)
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
from typing import Sequence
|
|
2
|
+
import warnings
|
|
2
3
|
from ._proxy import TrioProxy
|
|
3
4
|
|
|
4
5
|
|
|
5
6
|
class ProxyChain:
|
|
6
7
|
def __init__(self, proxies: Sequence[TrioProxy]):
|
|
8
|
+
warnings.warn(
|
|
9
|
+
'This implementation of ProxyChain is deprecated and will be removed in the future',
|
|
10
|
+
DeprecationWarning,
|
|
11
|
+
stacklevel=2,
|
|
12
|
+
)
|
|
7
13
|
self._proxies = proxies
|
|
8
14
|
|
|
9
15
|
async def connect(
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import Optional
|
|
1
|
+
from typing import Optional
|
|
2
2
|
|
|
3
3
|
import trio
|
|
4
4
|
from ._stream import TrioSocketStream
|
|
@@ -7,7 +7,7 @@ from ._stream import TrioSocketStream
|
|
|
7
7
|
async def connect_tcp(
|
|
8
8
|
host: str,
|
|
9
9
|
port: int,
|
|
10
|
-
local_addr: Optional[
|
|
10
|
+
local_addr: Optional[str] = None,
|
|
11
11
|
) -> TrioSocketStream:
|
|
12
12
|
trio_stream = await trio.open_tcp_stream(
|
|
13
13
|
host=host,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import ssl
|
|
2
|
-
from typing import Optional
|
|
2
|
+
from typing import Any, Optional
|
|
3
3
|
|
|
4
4
|
import trio
|
|
5
5
|
|
|
@@ -47,16 +47,19 @@ class TrioProxy:
|
|
|
47
47
|
dest_port: int,
|
|
48
48
|
dest_ssl: Optional[ssl.SSLContext] = None,
|
|
49
49
|
timeout: Optional[float] = None,
|
|
50
|
+
**kwargs: Any,
|
|
50
51
|
) -> TrioSocketStream:
|
|
51
52
|
if timeout is None:
|
|
52
53
|
timeout = DEFAULT_TIMEOUT
|
|
53
54
|
|
|
55
|
+
local_addr = kwargs.get('local_addr')
|
|
54
56
|
try:
|
|
55
57
|
with trio.fail_after(timeout):
|
|
56
58
|
return await self._connect(
|
|
57
59
|
dest_host=dest_host,
|
|
58
60
|
dest_port=dest_port,
|
|
59
61
|
dest_ssl=dest_ssl,
|
|
62
|
+
local_addr=local_addr,
|
|
60
63
|
)
|
|
61
64
|
except trio.TooSlowError as e:
|
|
62
65
|
raise ProxyTimeoutError(f'Proxy connection timed out: {timeout}') from e
|
|
@@ -66,12 +69,14 @@ class TrioProxy:
|
|
|
66
69
|
dest_host: str,
|
|
67
70
|
dest_port: int,
|
|
68
71
|
dest_ssl: Optional[ssl.SSLContext] = None,
|
|
72
|
+
local_addr: Optional[str] = None,
|
|
69
73
|
) -> TrioSocketStream:
|
|
70
74
|
if self._forward is None:
|
|
71
75
|
try:
|
|
72
76
|
stream = await connect_tcp(
|
|
73
77
|
host=self._proxy_host,
|
|
74
78
|
port=self._proxy_port,
|
|
79
|
+
local_addr=local_addr,
|
|
75
80
|
)
|
|
76
81
|
except OSError as e:
|
|
77
82
|
raise ProxyConnectionError(
|
|
@@ -125,6 +130,6 @@ class TrioProxy:
|
|
|
125
130
|
return cls(*args, **kwargs)
|
|
126
131
|
|
|
127
132
|
@classmethod
|
|
128
|
-
def from_url(cls, url: str, **kwargs):
|
|
133
|
+
def from_url(cls, url: str, **kwargs) -> 'TrioProxy':
|
|
129
134
|
url_args = parse_proxy_url(url)
|
|
130
135
|
return cls(*url_args, **kwargs)
|