XX-net/XX-Net · warning

http req line fail:%s

Error message

http req line fail:%s

What it means

The plain-HTTP request line could not be split into 2 or 3 words (method [url [version]]), so the HTTP handler drops the request.

Source

Thrown at code/default/x_tunnel/local/proxy_handler.py:341

            sock.send(b'HTTP/1.1 200 OK\r\n\r\n')
        except:
            xlog.warn("https %r connect to %s:%d conn:%d closed.", self.client_address, host, port, conn_id)

        if (len(self.read_buffer) - self.buffer_start) > 0:
            g.session.conn_list[conn_id].transfer_received_data(self.read_buffer[self.buffer_start:])

        g.session.conn_list[conn_id].start(block=True)

    def http_handler(self, first_char):
        req_line = self.read_crlf_line()
        words = req_line.split()
        if len(words) == 3:
            method, url, http_version = words
        elif len(words) == 2:
            method, url = words
            http_version = b"HTTP/1.1"
        else:
            xlog.warn("http req line fail:%s", req_line)
            return

        method = first_char + method
        # if method not in ["GET", "HEAD", "POST", "PUT", "DELETE", "OPTIONS", "TRACE", "PATCH"]:
        #    xlog.warn("https req method not known:%s", method)

        if url.startswith(b"http://") or url.startswith(b"HTTP://"):
            o = urlparse(url)
            host, port = netloc_to_host_port(o.netloc)

            p = url[7:].find(b"/")
            if p >= 0:
                path = url[7+p:]
            else:
                path = b"/"
        else:
            header_block = self.read_headers()
            lines = header_block.split(b"\r\n")

View on GitHub (pinned to cfa5bc17b6)

Solutions

  1. Use a real HTTP client pointed at the local proxy
  2. Verify the port is the HTTP/SOCKS proxy port and not something else
  3. Ignore scanner noise
Defensive patterns

Strategy: validation

Validate before calling

words = req_line.split()
if not 2 <= len(words) <= 3: skip_request()

Prevention

When it happens

Trigger: Sending a malformed request line to the local proxy in HTTP mode: empty line, too many/few tokens, or binary garbage.

Common situations: Health checks or scanners writing raw bytes; clients speaking non-HTTP protocols on the proxy port.

Related errors


AI-assisted analysis of XX-net/XX-Net@cfa5bc17b6 (2026-08-27). Data as JSON: /api/errors/23eaaf3a8fdcfdb6. Report an issue: GitHub.