How to hook into raw network traffic? #416
-
For testing & debugging purposes, I need to be able to monitor the raw bytes: the serialized request that leaves, and the incoming response before it is deserialized. Is this currently possible? If not, can you point me to where in the code I should look - i.e., where in the code are requests serialized, and responses deserialized? Thanks for any help (the SDK is awesome, BTW!) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
There are a couple of ways. If you just want to see it, you can enable trace logging of the tracing_subscriber::fmt::init(); // tracing-subscriber = { version = "0.3", features = ["env-filter"] }
If you need to actually capture it, I'd suggest building something a connection that captures traffic as it runs. We have a few in the SDK already, the most sophisticated being dvr. You can then use this custom connection when constructing a client with |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
There are a couple of ways. If you just want to see it, you can enable trace logging of the
aws_smithy_http
crate.If you need to actually capture it, I'd suggest building something a connection that captures traffic as it runs. We have a few in the SDK already, the most sophisticated being dvr. You can then use this custom connection when constructing a client with
from_conf_conn
. You can see an example of doing this here.