aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/proxy
diff options
context:
space:
mode:
Diffstat (limited to 'libmproxy/proxy')
-rw-r--r--libmproxy/proxy/connection.py8
-rw-r--r--libmproxy/proxy/primitives.py6
-rw-r--r--libmproxy/proxy/server.py6
3 files changed, 11 insertions, 9 deletions
diff --git a/libmproxy/proxy/connection.py b/libmproxy/proxy/connection.py
index 9e03157a..49210e47 100644
--- a/libmproxy/proxy/connection.py
+++ b/libmproxy/proxy/connection.py
@@ -32,6 +32,10 @@ class ClientConnection(tcp.BaseHandler, stateobject.StateObject):
port=self.address.port
)
+ @property
+ def tls_established(self):
+ return self.ssl_established
+
_stateobject_attributes = dict(
ssl_established=bool,
timestamp_start=float,
@@ -112,6 +116,10 @@ class ServerConnection(tcp.TCPClient, stateobject.StateObject):
port=self.address.port
)
+ @property
+ def tls_established(self):
+ return self.ssl_established
+
_stateobject_attributes = dict(
state=list,
timestamp_start=float,
diff --git a/libmproxy/proxy/primitives.py b/libmproxy/proxy/primitives.py
index fd4eb882..a9f31181 100644
--- a/libmproxy/proxy/primitives.py
+++ b/libmproxy/proxy/primitives.py
@@ -2,12 +2,6 @@ from __future__ import absolute_import
from netlib import socks, tcp
-class ProxyError2(Exception):
- def __init__(self, message, cause=None):
- super(ProxyError2, self).__init__(message)
- self.cause = cause
-
-
class ProxyError(Exception):
def __init__(self, code, message, headers=None):
super(ProxyError, self).__init__(message)
diff --git a/libmproxy/proxy/server.py b/libmproxy/proxy/server.py
index 32d596ad..c107cbed 100644
--- a/libmproxy/proxy/server.py
+++ b/libmproxy/proxy/server.py
@@ -7,7 +7,7 @@ from netlib import tcp
from ..protocol.handle import protocol_handler
from .. import protocol2
-from .primitives import ProxyServerError, Log, ProxyError, ProxyError2
+from .primitives import ProxyServerError, Log, ProxyError
from .connection import ClientConnection, ServerConnection
@@ -79,12 +79,12 @@ class ConnectionHandler2:
self.config,
self.channel
)
- root_layer = protocol2.ReverseProxy(root_context, ("localhost", 5000), True, True)
+ root_layer = protocol2.Socks5IncomingLayer(root_context)
try:
for message in root_layer():
print("Root layer receveived: %s" % message)
- except ProxyError2 as e:
+ except protocol2.ProtocolException as e:
self.log(e, "info")
except Exception:
self.log(traceback.format_exc(), "error")