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,
|
req = HTTPRequest.from_stream(self.c.client_conn.rfile,
|
||||||
body_size_limit=self.c.config.body_size_limit)
|
body_size_limit=self.c.config.body_size_limit)
|
||||||
self.c.log("request", "debug", [req._assemble_first_line(req.form_in)])
|
self.c.log("request", "debug", [req._assemble_first_line(req.form_in)])
|
||||||
send_upstream = self.process_request(flow, req)
|
send_request_upstream = self.process_request(flow, req)
|
||||||
if not send_upstream:
|
if not send_request_upstream:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
# Be careful NOT to assign the request to the flow before
|
# 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.priority = priority
|
||||||
|
|
||||||
self.peername = None
|
self.peername = None
|
||||||
|
self.sockname = None
|
||||||
self.timestamp_start = None
|
self.timestamp_start = None
|
||||||
self.timestamp_end = None
|
self.timestamp_end = None
|
||||||
self.timestamp_tcp_setup = None
|
self.timestamp_tcp_setup = None
|
||||||
@ -76,6 +77,7 @@ class ServerConnection(tcp.TCPClient, stateobject.SimpleStateObject):
|
|||||||
|
|
||||||
_stateobject_attributes = dict(
|
_stateobject_attributes = dict(
|
||||||
peername=tuple,
|
peername=tuple,
|
||||||
|
sockname=tuple,
|
||||||
timestamp_start=float,
|
timestamp_start=float,
|
||||||
timestamp_end=float,
|
timestamp_end=float,
|
||||||
timestamp_tcp_setup=float,
|
timestamp_tcp_setup=float,
|
||||||
@ -117,6 +119,7 @@ class ServerConnection(tcp.TCPClient, stateobject.SimpleStateObject):
|
|||||||
self.timestamp_start = utils.timestamp()
|
self.timestamp_start = utils.timestamp()
|
||||||
tcp.TCPClient.connect(self)
|
tcp.TCPClient.connect(self)
|
||||||
self.peername = self.connection.getpeername()
|
self.peername = self.connection.getpeername()
|
||||||
|
self.sockname = self.connection.getsockname()
|
||||||
self.timestamp_tcp_setup = utils.timestamp()
|
self.timestamp_tcp_setup = utils.timestamp()
|
||||||
|
|
||||||
def send(self, message):
|
def send(self, message):
|
||||||
|
Loading…
Reference in New Issue
Block a user