From 32f60ac28acc870e6d36e2e1d9c4099589e85b77 Mon Sep 17 00:00:00 2001 From: Serhii Dylda Date: Sun, 8 Nov 2020 22:56:56 +0100 Subject: [PATCH] Add warning in docs about discouraging of using tuple proxies. --- readthedocs/basic/signing-in.rst | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/readthedocs/basic/signing-in.rst b/readthedocs/basic/signing-in.rst index 6685d2bd..be580913 100644 --- a/readthedocs/basic/signing-in.rst +++ b/readthedocs/basic/signing-in.rst @@ -131,31 +131,15 @@ with (of course, replacing the IP and port with the IP and port of the proxy). -The ``proxy=`` argument should be a tuple, a list or a dict, +The ``proxy=`` argument should be a dict (or tuple, for backwards compatibility), consisting of parameters described `in aiosocks usage`__. Example: -* All of these are equal: - .. code-block:: python - proxy = ('socks5', '1.1.1.1', 5555, True, 'foo', 'bar') - proxy = (socks.SOCKS5, '1.1.1.1', 5555, True, 'foo', 'bar') - proxy = (2, '1.1.1.1', 5555, True, 'foo', 'bar') - -* All of these are equal: - -.. code-block:: python - - proxy = ['socks5', '1.1.1.1', 5555, True, 'foo', 'bar'] - proxy = [socks.SOCKS5, '1.1.1.1', 5555, True, 'foo', 'bar'] - proxy = [2, '1.1.1.1', 5555, True, 'foo', 'bar'] - -* .. code-block:: python - proxy = { - 'proxy_type': 'socks5', # (mandatory) protocol to use, allowed values: 'socks5' (or 2), 'socks4' (or 1) + 'proxy_type': 'socks5', # (mandatory) protocol to use, allowed values: 'socks5', 'socks4' 'addr': '1.1.1.1', # (mandatory) proxy IP address 'port': 5555, # (mandatory) proxy port number 'username': 'foo', # (optional) username if the proxy requires auth @@ -163,6 +147,15 @@ Example: 'rdns': True # (optional) whether to use remote or local resolve, default remote } + +For backwards compatibility with ``PySocks`` the following format +is possible (but discouraged): + +.. code-block:: python + + proxy = (socks.SOCKS5, '1.1.1.1', 5555, True, 'foo', 'bar') + + .. __: https://github.com/nibrag/aiosocks#installation .. __: https://github.com/nibrag/aiosocks#usage