如何修复TCP代理中的管道损坏错误

时间:2018-09-11 01:02:28

标签: python proxy broken-pipe

您好,我最近一直在使用python并正在阅读Blackhat Python,这使我创建了一个tcpproxy并在行上出现了管道破裂的错误

                # Send it to our request handler

                local_buffer = request_handler(local_buffer)

                # Send off the data to the remote host
                remote_socket.send(remote_buffer)

                print "[==>] Sent %d bytes" %len(local_buffer)
            # Receive back the response
            remote_buffer = receive_from(remote_socket)

            if len(remote_buffer):

                print "[<== Received %d bytes from remote." % len(remote_buffer)
                hexdump(remote_buffer)
                # Send to our response handler
                remote_buffer = response_handler(remote_buffer)

                # Send the response to the local socket
                client_socket.send(remote_buffer) # Here's where the
                                                  # Broken pipe starts

0 个答案:

没有答案