Skip to content

Commit

Permalink
Remove socks proxy protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanprjcts committed Mar 15, 2018
1 parent 9458c3e commit 97ffeb2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 23 deletions.
11 changes: 11 additions & 0 deletions docs/about/release-notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ To upgrade Sdklib to the latest version, use pip:
pip install -U sdklib


Sdklib 1.10.x series
===================

Sdklib 1.10.0
-------------

- Fix bug setting cookies after receiving several "Set-Cookie" headers.
- Update urllib3 version.
- Remove experimental support to proxy socks protocol.


Sdklib 1.9.x series
===================

Expand Down
20 changes: 4 additions & 16 deletions sdklib/http/base.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import copy
import urllib3
try:
from urllib3.contrib.socks import SOCKSProxyManager
except ImportError:
def SOCKSProxyManager(*args, **kwargs):
raise Exception("Missing dependencies for SOCKS support.")

from sdklib.http.renderers import MultiPartRenderer, get_renderer, default_renderer
from sdklib.http.session import Cookie
Expand Down Expand Up @@ -338,17 +333,10 @@ def default_headers(self):
@staticmethod
def get_pool_manager(proxy=None):
if proxy is not None:
scheme , _, _ = get_hostname_parameters_from_url(proxy)
if scheme.startswith("socks"):
pm = SOCKSProxyManager(
proxy,
num_pools=10
)
else:
pm = urllib3.ProxyManager(
proxy,
num_pools=10,
)
pm = urllib3.ProxyManager(
proxy,
num_pools=10,
)
else:
pm = urllib3.PoolManager(
num_pools=10,
Expand Down
8 changes: 1 addition & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,5 @@ def read_file(filepath):
'Programming Language :: Python :: 3.5',
],
packages=find_packages(exclude=EXCLUDE_FROM_PACKAGES),
zip_safe=False,
extras_require={
'socks': [
'PySocks>=1.5.6,<2.0,!=1.5.7'
]

},
zip_safe=False
)

0 comments on commit 97ffeb2

Please sign in to comment.