support http client

This commit is contained in:
zizifn
2022-12-06 02:02:13 +08:00
committed by zizifn
parent 6cd5aab68a
commit edf445b532
4 changed files with 43 additions and 16 deletions

View File

@@ -34,8 +34,10 @@ ${userID ? 'has UUID env' : 'no UUID env'}
hostname: serverAddress,
});
// request.body readablestream end casue socket to be end, this will casue socket send FIN package early
// 1. request.body readablestream end casue socket to be end, this will casue socket send FIN package early
// and casue deno can't get TCP pcakge.
// 2. current soluction for this, let proxy client wait for few ms and then end readablestream
// 3. this is only inpact HTTP proxy not https
const proxyResp = request.body?.pipeThrough(connection);
return new Response(proxyResp, {
status: 200,