Skip to content

Commit

Permalink
8010 → 8011
Browse files Browse the repository at this point in the history
  • Loading branch information
Gallaecio committed May 4, 2021
1 parent 7fc1f2d commit f41db0a
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion docs/index.rst
Expand Up @@ -36,7 +36,7 @@ Configuration
zyte_smartproxy_apikey = 'apikey'


* (optional) If you are not using the default Zyte Smart Proxy Manager proxy (``http://proxy.zyte.com:8010``),
* (optional) If you are not using the default Zyte Smart Proxy Manager proxy (``http://proxy.zyte.com:8011``),
for example if you have a dedicated or private instance,
make sure to also set ``ZYTE_SMARTPROXY_URL`` in ``settings.py``, e.g.::

Expand Down
2 changes: 1 addition & 1 deletion docs/news.rst
Expand Up @@ -21,7 +21,7 @@ following backward-incompatible changes:
- ``scrapy_crawlera`` is now ``scrapy_zyte_smartproxy``.

- ``CrawleraMiddleware`` is now ``ZyteSmartProxyMiddleware``, and its default
``url`` is now ``http://proxy.zyte.com:8010``.
``url`` is now ``http://proxy.zyte.com:8011``.

- Stat prefixes have switched from ``crawlera/`` to ``zyte_smartproxy/``.

Expand Down
2 changes: 1 addition & 1 deletion docs/settings.rst
Expand Up @@ -15,7 +15,7 @@ Unique Zyte Smart Proxy Manager API key provided for authentication.
ZYTE_SMARTPROXY_URL
-------------------

Default: ``'http://proxy.zyte.com:8010'``
Default: ``'http://proxy.zyte.com:8011'``

Zyte Smart Proxy Manager instance URL, it varies depending on adquiring a private or dedicated instance. If Zyte Smart Proxy Manager didn't provide
you with a private instance URL, you don't need to specify it.
Expand Down
2 changes: 1 addition & 1 deletion scrapy_zyte_smartproxy/middleware.py
Expand Up @@ -15,7 +15,7 @@

class ZyteSmartProxyMiddleware(object):

url = 'http://proxy.zyte.com:8010'
url = 'http://proxy.zyte.com:8011'
maxbans = 400
ban_code = 503
download_timeout = 190
Expand Down
18 changes: 9 additions & 9 deletions tests/test_all.py
Expand Up @@ -83,7 +83,7 @@ def _assert_disabled(self, spider, settings=None):

def _assert_enabled(self, spider,
settings=None,
proxyurl='http://proxy.zyte.com:8010',
proxyurl='http://proxy.zyte.com:8011',
proxyauth=basic_auth_header('apikey', ''),
maxbans=400,
download_timeout=190):
Expand Down Expand Up @@ -177,23 +177,23 @@ def test_apikey(self):

def test_proxyurl(self):
self.spider.zyte_smartproxy_enabled = True
self.settings['ZYTE_SMARTPROXY_URL'] = 'http://localhost:8010'
self._assert_enabled(self.spider, self.settings, proxyurl='http://localhost:8010')
self.settings['ZYTE_SMARTPROXY_URL'] = 'http://localhost:8011'
self._assert_enabled(self.spider, self.settings, proxyurl='http://localhost:8011')

def test_proxyurl_no_protocol(self):
self.spider.zyte_smartproxy_enabled = True
self.settings['ZYTE_SMARTPROXY_URL'] = 'localhost:8010'
self._assert_enabled(self.spider, self.settings, proxyurl='http://localhost:8010')
self.settings['ZYTE_SMARTPROXY_URL'] = 'localhost:8011'
self._assert_enabled(self.spider, self.settings, proxyurl='http://localhost:8011')

def test_proxyurl_https(self):
self.spider.zyte_smartproxy_enabled = True
self.settings['ZYTE_SMARTPROXY_URL'] = 'https://localhost:8010'
self._assert_enabled(self.spider, self.settings, proxyurl='https://localhost:8010')
self.settings['ZYTE_SMARTPROXY_URL'] = 'https://localhost:8011'
self._assert_enabled(self.spider, self.settings, proxyurl='https://localhost:8011')

def test_proxyurl_including_noconnect(self):
self.spider.zyte_smartproxy_enabled = True
self.settings['ZYTE_SMARTPROXY_URL'] = 'http://localhost:8010?noconnect'
self._assert_enabled(self.spider, self.settings, proxyurl='http://localhost:8010?noconnect')
self.settings['ZYTE_SMARTPROXY_URL'] = 'http://localhost:8011?noconnect'
self._assert_enabled(self.spider, self.settings, proxyurl='http://localhost:8011?noconnect')

def test_maxbans(self):
self.spider.zyte_smartproxy_enabled = True
Expand Down

0 comments on commit f41db0a

Please sign in to comment.