Skip to content
Merged
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
2 changes: 1 addition & 1 deletion proxy/common/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
:copyright: (c) 2013-present by Abhinav Singh and contributors.
:license: BSD, see LICENSE for more details.
"""
VERSION = (2, 1, 0)
VERSION = (2, 1, 1)
__version__ = '.'.join(map(str, VERSION[0:3]))
5 changes: 3 additions & 2 deletions proxy/http/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,9 @@ def set_url(self, url: bytes) -> None:
def set_line_attributes(self) -> None:
if self.type == httpParserTypes.REQUEST_PARSER:
if self.method == httpMethods.CONNECT and self.url:
u = urlparse.urlsplit(b'//' + self.url.path)
self.host, self.port = u.hostname, u.port
self.host = self.url.scheme
self.port = 443 if self.url.path == b'' else \
int(self.url.path)
elif self.url:
self.host, self.port = self.url.hostname, self.url.port \
if self.url.port else DEFAULT_HTTP_PORT
Expand Down
3 changes: 2 additions & 1 deletion proxy/testing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"""
proxy.py
~~~~~~~~
⚡⚡⚡ Fast, Lightweight, Programmable Proxy Server in a single Python file.
⚡⚡⚡ Fast, Lightweight, Pluggable, TLS interception capable proxy server focused on
Network monitoring, controls & Application development, testing, debugging.

:copyright: (c) 2013-present by Abhinav Singh and contributors.
:license: BSD, see LICENSE for more details.
Expand Down
3 changes: 2 additions & 1 deletion proxy/testing/test_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"""
proxy.py
~~~~~~~~
⚡⚡⚡ Fast, Lightweight, Programmable Proxy Server in a single Python file.
⚡⚡⚡ Fast, Lightweight, Pluggable, TLS interception capable proxy server focused on
Network monitoring, controls & Application development, testing, debugging.

:copyright: (c) 2013-present by Abhinav Singh and contributors.
:license: BSD, see LICENSE for more details.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"""
from setuptools import setup, find_packages

VERSION = (2, 1, 0)
VERSION = (2, 1, 1)
__version__ = '.'.join(map(str, VERSION[0:3]))
__description__ = '''⚡⚡⚡Fast, Lightweight, Pluggable, TLS interception capable proxy server
focused on Network monitoring, controls & Application development, testing, debugging.'''
Expand Down
5 changes: 5 additions & 0 deletions tests/http/test_http_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ class TestHttpParser(unittest.TestCase):
def setUp(self) -> None:
self.parser = HttpParser(httpParserTypes.REQUEST_PARSER)

def test_urlparse(self) -> None:
self.parser.parse(b'CONNECT httpbin.org:443 HTTP/1.1\r\n')
self.assertEqual(self.parser.host, b'httpbin.org')
self.assertEqual(self.parser.port, 443)

def test_build_request(self) -> None:
self.assertEqual(
build_http_request(
Expand Down