diff options
author | Sandor Nemes <sandor.nemes@gmail.com> | 2016-01-18 15:52:03 +0100 |
---|---|---|
committer | Sandor Nemes <sandor.nemes@gmail.com> | 2016-01-18 15:52:03 +0100 |
commit | 61bd318622fbb3035ad2ff07315ef328e4aad503 (patch) | |
tree | 3e99fe1f19db65e1939422fb59c53f4b8c08c96d | |
parent | 918a457f5a6e4b3281f86ba31107d0a05082fb5e (diff) | |
download | mitmproxy-61bd318622fbb3035ad2ff07315ef328e4aad503.tar.gz mitmproxy-61bd318622fbb3035ad2ff07315ef328e4aad503.tar.bz2 mitmproxy-61bd318622fbb3035ad2ff07315ef328e4aad503.zip |
remove unnecessary source_address from proxy modes
-rw-r--r-- | libmproxy/protocol/base.py | 2 | ||||
-rw-r--r-- | libmproxy/proxy/modes/http_proxy.py | 1 | ||||
-rw-r--r-- | libmproxy/proxy/modes/reverse_proxy.py | 1 | ||||
-rw-r--r-- | libmproxy/proxy/modes/socks_proxy.py | 1 | ||||
-rw-r--r-- | libmproxy/proxy/modes/transparent_proxy.py | 1 |
5 files changed, 1 insertions, 5 deletions
diff --git a/libmproxy/protocol/base.py b/libmproxy/protocol/base.py index cf8771e0..d984cadb 100644 --- a/libmproxy/protocol/base.py +++ b/libmproxy/protocol/base.py @@ -111,7 +111,7 @@ class ServerConnectionMixin(object): def __init__(self, server_address=None): super(ServerConnectionMixin, self).__init__() - self.server_conn = ServerConnection(server_address) + self.server_conn = ServerConnection(server_address, (self.config.host, 0)) self.__check_self_connect() def __check_self_connect(self): diff --git a/libmproxy/proxy/modes/http_proxy.py b/libmproxy/proxy/modes/http_proxy.py index 27da57dd..c7502c24 100644 --- a/libmproxy/proxy/modes/http_proxy.py +++ b/libmproxy/proxy/modes/http_proxy.py @@ -16,7 +16,6 @@ class HttpProxy(Layer, ServerConnectionMixin): class HttpUpstreamProxy(Layer, ServerConnectionMixin): def __init__(self, ctx, server_address): super(HttpUpstreamProxy, self).__init__(ctx, server_address=server_address) - self.server_conn.source_address = (ctx.config.host, 0) def __call__(self): layer = self.ctx.next_layer(self) diff --git a/libmproxy/proxy/modes/reverse_proxy.py b/libmproxy/proxy/modes/reverse_proxy.py index 3ff22b6c..28f4e6f8 100644 --- a/libmproxy/proxy/modes/reverse_proxy.py +++ b/libmproxy/proxy/modes/reverse_proxy.py @@ -6,7 +6,6 @@ from ...protocol import Layer, ServerConnectionMixin class ReverseProxy(Layer, ServerConnectionMixin): def __init__(self, ctx, server_address, server_tls): super(ReverseProxy, self).__init__(ctx, server_address=server_address) - self.server_conn.source_address = (ctx.config.host, 0) self.server_tls = server_tls def __call__(self): diff --git a/libmproxy/proxy/modes/socks_proxy.py b/libmproxy/proxy/modes/socks_proxy.py index 6e0b927b..90788e37 100644 --- a/libmproxy/proxy/modes/socks_proxy.py +++ b/libmproxy/proxy/modes/socks_proxy.py @@ -10,7 +10,6 @@ from ...protocol import Layer, ServerConnectionMixin class Socks5Proxy(Layer, ServerConnectionMixin): def __init__(self, ctx): super(Socks5Proxy, self).__init__(ctx) - self.server_conn.source_address = (ctx.config.host, 0) def __call__(self): try: diff --git a/libmproxy/proxy/modes/transparent_proxy.py b/libmproxy/proxy/modes/transparent_proxy.py index 995e4bd9..da1d4632 100644 --- a/libmproxy/proxy/modes/transparent_proxy.py +++ b/libmproxy/proxy/modes/transparent_proxy.py @@ -8,7 +8,6 @@ from ...protocol import Layer, ServerConnectionMixin class TransparentProxy(Layer, ServerConnectionMixin): def __init__(self, ctx): super(TransparentProxy, self).__init__(ctx) - self.server_conn.source_address = (ctx.config.host, 0) self.resolver = platform.resolver() def __call__(self): |