accumulate the total bytes received from client requests using r->request_length - #1998
accumulate the total bytes received from client requests using r->request_length#1998finditfun wants to merge 3 commits into
Conversation
…uest_length The $request_length variable records only the size of the request line and headers during the CONNECT method in this module, and does not include the TLS handshake or request body bytes transmitted after the tunnel is established. In the code, the subsequent bytes read from the client are added to r->request_length, allowing observation of the total packet size sent by clients in forward proxy requests via the $request_length field in logs.
|
Thank you for this contribution! I've reviewed the changes and have some concerns regarding the semantic consistency of Concern: Semantic mismatch In Nginx/Tengine, `` is officially defined as:
This variable is meant to track HTTP-layer request size. However, in CONNECT tunnel mode, the subsequent data transferred through the tunnel is raw TCP traffic (typically encrypted TLS streams), not HTTP requests. Adding these bytes to Additional issue: Incomplete statistics The condition Suggested alternative If you need to track CONNECT tunnel traffic, I recommend:
This would preserve the semantic integrity of `` while providing accurate tunnel traffic metrics. Would you be open to revising the implementation along these lines? |
Added variables to track bytes sent and received in the proxy connect module. Implemented a new variable function to retrieve these values.
|
@drawing Added variables to track bytes sent and received in the proxy connect module. Implemented a new variable function to retrieve these values. |
The $request_length variable records only the size of the request line and headers during the CONNECT method in this module, and does not include the TLS handshake or request body bytes transmitted after the tunnel is established.
In the code, the subsequent bytes read from the client are added to r->request_length, allowing observation of the total packet size sent by clients in forward proxy requests via the $request_length field in logs.