mirror of https://github.com/ospab/ostp.git
fix: revert UoT POST back to GET for direct DPI bypass without proxy
This commit is contained in:
parent
9e2b29723c
commit
960382e93b
|
|
@ -88,10 +88,9 @@ pub async fn connect_xhttp(
|
|||
let http_host = if sni.is_empty() { target_ip.to_string() } else { sni.to_string() };
|
||||
|
||||
let req = format!(
|
||||
"POST /stream HTTP/1.1\r\n\
|
||||
"GET /stream HTTP/1.1\r\n\
|
||||
Host: {}\r\n\
|
||||
Authorization: Bearer {}\r\n\
|
||||
Content-Length: 99999999999\r\n\
|
||||
Connection: keep-alive\r\n\
|
||||
\r\n",
|
||||
http_host, auth_token
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ pub async fn handle_tcp_connection(
|
|||
let headers_str = String::from_utf8_lossy(&buf[..header_len]);
|
||||
|
||||
// Fast-fail scanner bots
|
||||
if !headers_str.starts_with("POST /stream HTTP/1.1\r\n") {
|
||||
if !headers_str.starts_with("GET /stream HTTP/1.1\r\n") {
|
||||
send_404(&mut stream).await?;
|
||||
anyhow::bail!("invalid request line");
|
||||
}
|
||||
|
|
@ -108,7 +108,7 @@ pub async fn handle_tcp_connection(
|
|||
}
|
||||
|
||||
// Reply 200 OK
|
||||
let response = "HTTP/1.1 200 OK\r\nX-Ostp-Server: 1\r\nContent-Length: 99999999999\r\nConnection: keep-alive\r\n\r\n";
|
||||
let response = "HTTP/1.1 200 OK\r\nX-Ostp-Server: 1\r\nConnection: keep-alive\r\n\r\n";
|
||||
stream.write_all(response.as_bytes()).await?;
|
||||
|
||||
info!("UoT client authenticated from {}", peer_addr);
|
||||
|
|
|
|||
Loading…
Reference in New Issue