Skip to content

Add header payload support #146

Description

@HypeMaxers

I'm trying to use direct ssh with websockets but it isn't connecting with me.

Here are the logs: D/SlipNetVpnService: Private DNS: opportunistic (default, safe for most networks)
I/SlipNetVpnService: Starting VPN with tunnel type: SSH
I/SlipNetVpnService: Remote DNS: 8.8.8.8 (fallback: 1.1.1.1)
D/SlipNetVpnService: Excluded app from VPN: app.slipnet
I/SshTunnel[default]: Configured: cipher=auto, compression=false, maxChannels=32
I/SlipNetVpnService: Starting SSH tunnel (HTTP proxy fbi.gov:80 -> REDACTED:22)
I/SshTunnel[default]: ========================================
I/SshTunnel[default]: Starting SSH tunnel (over HTTP CONNECT proxy)
I/SshTunnel[default]: SSH target: REDACTED:22
I/SshTunnel[default]: SSH User: REDACTED
I/SshTunnel[default]: HTTP proxy: fbi.gov:80
I/SshTunnel[default]: Custom Host header: REDACTED
I/SshTunnel[default]: SOCKS5 Listen: 127.0.0.1:10880
I/SshTunnel[default]: Block direct DNS: true
I/SshTunnel[default]: Remote DNS: 8.8.8.8 (fallback: 1.1.1.1)
I/SshTunnel[default]: ========================================
I/ProxyHttpConnect: Connecting to HTTP proxy fbi.gov:80 -> REDACTED:22
I/ProxyHttpConnect: Custom Host header:
REDACTED
D/ProxyHttpConnect: TX: CONNECT REDACTED:22 (Host: REDACTED)
D/ProxyHttpConnect: RX: HTTP/1.1 400 Bad Request
E/SshTunnel[default]: Failed to start SSH tunnel over HTTP proxy
java.lang.RuntimeException: HTTP proxy CONNECT failed: HTTP/1.1 400 Bad Request

I'm basically trying to replicate this payload.

GET / HTTP/1.1[crlf]Host: fbi.gov[crlf][crlf]CF-RAY / HTTP/1.1[crlf]Host: [host][crlf]Upgrade: websocket[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Upgrade: websocket[crlf][crlf]

Pasting the entire payload in the host header field returns syntax error however I see that what's supposed to be written there is just the domain which is what I did but it still returns error 400

I assume it's because of the CONNECT method?

~ $ curl -v -X CF-RAY fbi.gov -H 'Host: cloudflare-staging.speedtest.net'

returns:

  • Request completely sent off
    < HTTP/1.1 301 Moved Permanently
    < Date: Fri, 19 Jun 2026 01:50:04 GMT
    < Content-Length: 0
    < Connection: keep-alive
    < Nel: {"report_to":"cf-nel","success_fraction":0.0,"max_age":604800}
    < Retry-After: 0
    < Location: https://cloudflare-staging.speedtest.net/
    < Accept-Ranges: bytes
    < Cf-Cache-Status: DYNAMIC
    < Report-To: {"group":"cf-nel","max_age":604800,"endpoints":[{"url":"https://a.nel.cloudflare.com/report/v4?s=AOp8rt1e61Yah7BWq8AW9LKf%2B9WO9noHgBcWfcxHkuDErK2n7%2FHYh3EYH6smY1o0au1CKCgQg4W3AdtB4zZYZFQfFdnntwJJnvHgF58xOCy6UcAtXflMkGqcWrIlX%2FdFFv8zR2oQqmEMIsE%2FE7J6V5fccw%3D%3D"}]}
    < Server: cloudflare
    < CF-RAY: a0dee17d0d9ce244-MRS
    < alt-svc: h3=":443"; ma=86400
    <
  • Connection #0 to host fbi.gov:80 left intact

Meanwhile

curl -v -X CONNECT fbi.gov -H 'Host: cloudflare-staging.speedtest.net'

Returns:

  • Request completely sent off
    < HTTP/1.1 400 Bad Request
    < Date: Fri, 19 Jun 2026 01:51:14 GMT
    < Content-Type: text/plain; charset=UTF-8
    < Content-Length: 16
    < Connection: keep-alive
    < Cache-Control: private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0
    < Expires: Thu, 01 Jan 1970 00:00:01 GMT
    < Referrer-Policy: same-origin
    < Nel: {"report_to":"cf-nel","success_fraction":0.0,"max_age":604800}
    < X-Frame-Options: SAMEORIGIN
    < Report-To: {"group":"cf-nel","max_age":604800,"endpoints":[{"url":"https://a.nel.cloudflare.com/report/v4?s=iIRodLQFebGViNQEpilNMGH2UJl%2BJC5DD2RgzlPyWkWsUlLdUwosfKagTWah43uS4gVbsfRhZKbXZqZSp1uqa5ejaOc8vHyh6JU75amwKycdj2K%2B9MzMZphuA%2FpoxyS8qNlWThmKe9dkzFYyYhX0s6tHhg%3D%3D"}]}
    < Server: cloudflare
    < CF-RAY: a0dee3318857e177-MRS
    <
  • Connection #0 to host fbi.gov:80 left intact
    error code: 1045

In the kotlin file for http connect I see that it's hardcoded to the "CONNECT'' method is this intentional?

val connectReq = "CONNECT $host:$port HTTP/1.1\r\n" +

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions