3.0 flow.client_conn.ip_address returns something different than before


#1

Just reporting in with differences here, but why/what reasons was there to change the following code:
ip, port = str(flow.client_conn.ip_address).split(":") #2.0.2
ip, port = flow.client_conn.ip_address[0].split(":")[3], flow.client_conn.ip_address[1] #3.0


#2

We previously had our own tcp.Address class, which was basically a wrapper around an addressinfo tuple that provided a few nice features such as a useful str representation. Ultimately we felt it however introduced too many inconsistencies, and we changed it to a simple tuple just like Python’s socket module. If you want a nice string representation, check out mitmproxy.utils.human.format_address.