mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 00:01:36 +00:00
expose sockname
This commit is contained in:
parent
decb6f998a
commit
84a016dccf
@ -897,8 +897,8 @@ class HTTPHandler(ProtocolHandler, TemporaryServerChangeMixin):
|
||||
req = HTTPRequest.from_stream(self.c.client_conn.rfile,
|
||||
body_size_limit=self.c.config.body_size_limit)
|
||||
self.c.log("request", "debug", [req._assemble_first_line(req.form_in)])
|
||||
send_upstream = self.process_request(flow, req)
|
||||
if not send_upstream:
|
||||
send_request_upstream = self.process_request(flow, req)
|
||||
if not send_request_upstream:
|
||||
return True
|
||||
|
||||
# Be careful NOT to assign the request to the flow before
|
||||
|
@ -69,6 +69,7 @@ class ServerConnection(tcp.TCPClient, stateobject.SimpleStateObject):
|
||||
self.priority = priority
|
||||
|
||||
self.peername = None
|
||||
self.sockname = None
|
||||
self.timestamp_start = None
|
||||
self.timestamp_end = None
|
||||
self.timestamp_tcp_setup = None
|
||||
@ -76,6 +77,7 @@ class ServerConnection(tcp.TCPClient, stateobject.SimpleStateObject):
|
||||
|
||||
_stateobject_attributes = dict(
|
||||
peername=tuple,
|
||||
sockname=tuple,
|
||||
timestamp_start=float,
|
||||
timestamp_end=float,
|
||||
timestamp_tcp_setup=float,
|
||||
@ -117,6 +119,7 @@ class ServerConnection(tcp.TCPClient, stateobject.SimpleStateObject):
|
||||
self.timestamp_start = utils.timestamp()
|
||||
tcp.TCPClient.connect(self)
|
||||
self.peername = self.connection.getpeername()
|
||||
self.sockname = self.connection.getsockname()
|
||||
self.timestamp_tcp_setup = utils.timestamp()
|
||||
|
||||
def send(self, message):
|
||||
|
Loading…
Reference in New Issue
Block a user