mirror of
https://github.com/lush2020/edgetunnel.git
synced 2026-03-24 00:48:39 +08:00
chaneg deno code
This commit is contained in:
@@ -34,12 +34,19 @@ ${userID ? 'has UUID env' : 'no UUID env'}
|
|||||||
hostname: serverAddress,
|
hostname: serverAddress,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// const proxyResp = request.body?.pipeThrough(connection);
|
||||||
// 1. 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.
|
// and casue deno can't get TCP pcakge.
|
||||||
// 2. current soluction for this, let proxy client wait for few ms and then end readablestream
|
// 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
|
// 3. this is only inpact HTTP proxy not https
|
||||||
const proxyResp = request.body?.pipeThrough(connection);
|
(async () => {
|
||||||
return new Response(proxyResp, {
|
for await (let chunk of request.body || []) {
|
||||||
|
// console.log(new TextDecoder().decode(chunk));
|
||||||
|
connection.write(chunk);
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
|
||||||
|
return new Response(connection.readable, {
|
||||||
status: 200,
|
status: 200,
|
||||||
headers: {},
|
headers: {},
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user