How to track a specific TCP connection in Axum? #2952
-
SummaryI'm trying to track a particular TCP connection across calls to the endpoints in axum. I specifically want a per-connection request handling in my app (I am 100% certain that the compliant HTTP client will have keep-alive set). I know there is a mechanism to track remote port and IP that is discussed in #43, but I would much prefer having an actual connection tracking primitive (if there is one) rather than global state in the app tracking specific socket addresses and a mess of timeouts to clean that map. I imagine deep inside hyper actually tracks the specific TCP connections, so would appreciate if someone knows how to get to that info. Thanks! axum version0.7.7 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
See |
Beta Was this translation helpful? Give feedback.
See
serve-with-hyper
for an example of how to drive the TCP accept loop yourself, where you can then add whatever connection tracking code you want.