mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-11-18 06:28:25 +01:00
Yaak Proxy: dial the server before answering a CONNECT
The engine now opens the TCP connection to a CONNECT's server before it answers. When the server can't be reached, the CONNECT gets a 502 (or a 504 on a timeout) and the client reports its own connection error, rather than a 200 followed by a 502 inside the decrypted session or a silent hang-up in a tunnel. The failure is recorded as one error flow. The dialled connection is handed to the tunnel, or to the first upstream connection of a decrypted one, so nothing is dialled twice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
649549482c
commit
ea288ec074
14 files changed
+889
-106
No files matched your search
@@ -4,7 +4,7 @@ import { fixtures } from "./fixtures";
|
||||
/**
|
||||
* Dev only: traffic for HTTPS decryption's states, by `?scene=`: `encrypted`, the first minute
|
||||
* with nothing decrypted, and `mixed`, some decrypted, a refused handshake and the tunnel passed
|
||||
* through after it.
|
||||
* through after it, and a server that could not be reached.
|
||||
*/
|
||||
export type HttpsScene = "encrypted" | "mixed";
|
||||
|
||||
@@ -169,6 +169,19 @@ function mixedScene(): Flow[] {
|
||||
}),
|
||||
decrypted(9, 0, "https://api.typefully.com/v1/drafts", apps.dia),
|
||||
tunnel(10, "www.google.com", apps.dia, { elapsedMs: null }),
|
||||
{
|
||||
...tunnel(11, "jig3d.com", apps.dia),
|
||||
method: "",
|
||||
url: "https://jig3d.com",
|
||||
tunnelled: false,
|
||||
tunnelReason: null,
|
||||
error:
|
||||
"DNS lookup failed: failed to lookup address information: nodename nor servname provided, or not known",
|
||||
elapsedMs: 3,
|
||||
remoteAddr: null,
|
||||
requestSize: 0,
|
||||
responseSize: 0,
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user