def go(conn: TcpConnection) -> None: conn.on('data', out) conn.write(b"GET / HTTP/1.1\r\nHost: %s\r\n\r\n" % test_host) conn.pause(False)
def handle_conn(self, tcp_conn: TcpConnection) -> None: http_conn = HttpServerConnection(tcp_conn, self) tcp_conn.on('data', http_conn.handle_input) tcp_conn.on('close', http_conn.conn_closed) tcp_conn.on('pause', http_conn.res_body_pause) tcp_conn.pause(False)