code: def parse_line(line):
      
      if not line.startswith(b'PROXY'):
          raise exc.InvalidLine('Missing "PROXY" prefix', line)
      if not line.endswith(CRLF):
          raise exc.InvalidLine('Missing "\\r\\n" terminal', line)
      parts = line[:-len(CRLF)].split(b' ')
      if len(parts) != 6:
          raise exc.InvalidLine('Expected 6 " " delimited parts', line)
  
      inet, src_addr, dst_addr = parts[1:4]
      if inet == b'TCP4':
          try:
              socket.inet_pton(socket.AF_INET, src_addr)
              socket.inet_pton(socket.AF_INET, dst_addr)
          except socket.error:
              raise exc.InvalidLine('Invalid INET {0} address(es)'.format(inet), line)
      elif inet == b'TCP6':
          try:
              socket.inet_pton(socket.AF_INET6, src_addr)
              socket.inet_pton(socket.AF_INET6, dst_addr)
          except socket.error:
              raise exc.InvalidLine('Invalid INET {0} address(es)'.format(inet), line)
      else:
          raise exc.InvalidLine('Unsupported INET "{0}"'.format(inet), line)
      try:
          src_port = int(parts[4])
          dst_port = int(parts[5])
      except (TypeError, ValueError):
          raise exc.InvalidLine(line, 'Invalid port')
  
      return ProxyInfo(
          source_address=src_addr,
          source_port=src_port,
          destination_address=dst_addr,
          destination_port=dst_port,
      )
docs: Parses a byte string like:
  
         PROXY TCP4 192.168.0.1 192.168.0.11 56324 443\r\n
  
      to a `ProxyInfo`.