Commit 00ac2f7
Fix command output, proxy setup, and HTTPS forwarding (#47)
* fix: always pipe command to stdout
* basic fixes
* Fix CONNECT handling in TLS termination path
CONNECT requests coming through TLS termination were incorrectly
forwarded as regular HTTP requests instead of being handled by
handleConnect. This caused 400 errors when clients used CONNECT.
The fix adds proper CONNECT detection in handleDecryptedHTTPS,
matching the behavior in handleHTTP.
* Use http:// for HTTPS_PROXY in unprivileged mode
HTTPS_PROXY should use http:// to establish CONNECT tunnels
to the proxy, not https://. This is the standard approach
for HTTP proxies handling HTTPS traffic via CONNECT.
The proxy will still perform TLS termination on the tunneled
connections for full request visibility.
* Add debugging for TLS connection hangs in CONNECT handling
- Add read timeout to detect clients that don't send HTTP requests
- Add detailed TLS connection state logging
- Better error handling for timeout scenarios
This should help diagnose why CONNECT tunnels hang after TLS handshake.
* Fix SetReadTimeout compilation error
Replace SetReadTimeout (which doesn't exist) with SetReadDeadline.
Also reset the deadline after each successful request to allow
multiple requests on the same TLS connection.
* fix
---------
Co-authored-by: blink-so[bot] <211532188+blink-so[bot]@users.noreply.github.com>1 parent a5b051d commit 00ac2f7
3 files changed
+56
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
183 | | - | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
184 | 190 | | |
185 | 191 | | |
186 | 192 | | |
| |||
292 | 298 | | |
293 | 299 | | |
294 | 300 | | |
295 | | - | |
| 301 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| 37 | + | |
36 | 38 | | |
37 | | - | |
38 | | - | |
39 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
40 | 46 | | |
41 | 47 | | |
42 | 48 | | |
| |||
53 | 59 | | |
54 | 60 | | |
55 | 61 | | |
56 | | - | |
| 62 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
| 136 | + | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
140 | | - | |
| 139 | + | |
| 140 | + | |
141 | 141 | | |
142 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
143 | 147 | | |
144 | 148 | | |
145 | | - | |
| 149 | + | |
146 | 150 | | |
147 | 151 | | |
148 | 152 | | |
| |||
303 | 307 | | |
304 | 308 | | |
305 | 309 | | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
306 | 314 | | |
307 | 315 | | |
308 | 316 | | |
| |||
313 | 321 | | |
314 | 322 | | |
315 | 323 | | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
316 | 327 | | |
317 | 328 | | |
318 | 329 | | |
| |||
321 | 332 | | |
322 | 333 | | |
323 | 334 | | |
| 335 | + | |
| 336 | + | |
324 | 337 | | |
325 | 338 | | |
326 | 339 | | |
| |||
350 | 363 | | |
351 | 364 | | |
352 | 365 | | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
353 | 369 | | |
354 | 370 | | |
355 | 371 | | |
356 | 372 | | |
357 | 373 | | |
358 | 374 | | |
359 | 375 | | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
360 | 390 | | |
361 | | - | |
| 391 | + | |
362 | 392 | | |
363 | 393 | | |
364 | 394 | | |
365 | 395 | | |
366 | | - | |
| 396 | + | |
367 | 397 | | |
368 | 398 | | |
369 | 399 | | |
| |||
374 | 404 | | |
375 | 405 | | |
376 | 406 | | |
377 | | - | |
| 407 | + | |
378 | 408 | | |
379 | 409 | | |
380 | 410 | | |
| |||
493 | 523 | | |
494 | 524 | | |
495 | 525 | | |
496 | | - | |
| 526 | + | |
0 commit comments