Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added man-in-the-middle attack for proper HTTPS header checking. #129

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ __pycache__
.cache
build
dist
pip-wheel-metadata
.ropeproject
.python-version
12 changes: 6 additions & 6 deletions proxybroker/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def __init__(
providers=None,
verify_ssl=False,
loop=None,
**kwargs
**kwargs,
):
self._loop = loop or asyncio.get_event_loop()
self._proxies = queue or asyncio.Queue(loop=self._loop)
Expand Down Expand Up @@ -133,7 +133,7 @@ async def find(
strict=False,
dnsbl=None,
limit=0,
**kwargs
**kwargs,
):
"""Gather and check proxies from providers or from a passed data.

Expand Down Expand Up @@ -280,9 +280,9 @@ def serve(self, host='127.0.0.1', port=8888, limit=100, **kwargs):
timeout=self._timeout,
max_tries=kwargs.pop('max_tries', self._max_tries),
loop=self._loop,
**kwargs
**kwargs,
)
self._server.start()
asyncio.ensure_future(self._server.start())

task = asyncio.ensure_future(self.find(limit=limit, **kwargs))
self._all_tasks.append(task)
Expand Down Expand Up @@ -412,7 +412,7 @@ def stop(self):
if self._server:
self._server.stop()
self._server = None
log.info('Stop!')
log.debug('Stop!')

def _done(self):
log.debug('called done')
Expand All @@ -421,7 +421,7 @@ def _done(self):
if not task.done():
task.cancel()
self._push_to_result(None)
log.info('Done! Total found proxies: %d' % len(self.unique_proxies))
log.debug('Done! Total found proxies: %d' % len(self.unique_proxies))

def show_stats(self, verbose=False, **kwargs):
"""Show statistics on the found proxies.
Expand Down
3 changes: 1 addition & 2 deletions proxybroker/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,8 +426,7 @@ def cli(args=sys.argv[1:]):
strict=ns.strict,
dnsbl=ns.dnsbl,
)
print('Server started at http://%s:%d' % (ns.host, ns.port))


try:
if tasks:
loop.run_until_complete(asyncio.gather(*tasks, loop=loop))
Expand Down
Loading