| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
The problem is real, most solve it by having metrics in Cloudflare or some proxy, but yes it is a problem. However, a more generic logging callback that can be used for everything, not just HTTP would be better and has been discussed before. Probably something based on strings - strings are generic and in C/C++ you can compare them in constant time if you know the pointers, we already have this interface for WebSocket close reasons strings So the interface could probably be as simple as log((some reference, some string) => { }) the problem is that once you introduce such a callback, you need to review all the places it emits and test all possible actions one could take in that callback |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
In order to track all requests in a node.js project, I also want to keep track incoming requests that produce an internal http parsing error (mainly 431 Request Header Fields Too Large). As internal parsing errors result in response being written to the socket and closing the socket, there is no notion of these requests in the application.
By adding a callback handler, the application can be informed of requests that produced an internal error, allowing for an application to keep track of these requests and keep metrics on that.