how can we print http flow of a browser with python? [Like browser network tab]

73 Views Asked by At

In Python i want to build a program like browser network tab, which prints all http/s flows. The same thing needs to be done with python.

[#urllib #requests #basicHTTPRequest etc..] modules are there but how can i get the network traffic of a browser?

  1. can we achieve that by binding socket to proxy of a browser?

    sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    sock.bind(('0.0.0.0', port))
    sock.listen(1)
    self._sockets.append(sock)
    
  2. Need to create a tcp connection over that address and port of a proxy?

suggest me a good resource to achieve.

0

There are 0 best solutions below