计算 HTTPS POST 请求大小
我有一个将数据发送到 servlet 的中间件。
有人知道如何计算servlet中中间件的请求大小吗?
我正在尝试计算请求标头+请求大小+证书大小的总和 正确吗?
有了这个,我尝试重新创建请求:
http:// wikis.sun.com/display/WebServerdocs/Analyzing+SSL+Requests+and+Responses
I have a middlet that sends data to a servlet.
Anyone knows how can I calculate the size of request of the middlet in a servlet?
I'm tring to sum of request header + request size + certificate size
Is it correct?
With this I'm trying to recreate the request:
http://wikis.sun.com/display/WebServerdocs/Analyzing+SSL+Requests+and+Responses
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我很确定没有简单的方法。
事实上,我什至不确定这是否是一个有意义的衡量指标。请求头和请求体是HTTP应用协议的一部分。在 HTTP 内容开始之前,证书作为 SSL / TLS 设置的一部分发送。一旦 SSL / TLS 启动,HTTP 协议就会在 SSL / TLS 通道“之上”运行。
即使只是测量 HTTP 请求中的数据量也是很棘手的。典型的 HTTP 堆栈不会将整个请求消息组装在一处,并且不会保留发送的数据量的运行总数。根据您使用的 HTTP 堆栈,您可以(理论上)安排使用自定义套接字工厂和对发送的字节进行计数的套接字流。
I'm pretty sure that there is no simple way.
In fact, I'm not even sure this is a meaningful thing to measure. The request header and body are part of the HTTP application protocol. The certificate is sent as part of SSL / TLS setup ... before the HTTP stuff starts. And once SSL / TLS has started, the HTTP protocol is run "on top of" the SSL / TLS channel.
Even just measuring the amount of data in a HTTP request is tricky. A typical HTTP stack does not assemble the entire request message in one place, and does not keep a running total of the amount of data sent. Depending on the HTTP stack that you are using, you could (in theory) arrange to use a custom socket factory and socket streams that count the bytes sent.
阅读有关 SSL 握手:
我认为对话往返可能会让您担心以及数据包大小。
一旦握手阶段完成并且连接被重用(保持活动),仅发送 HTTP 数据,当然是加密的。
Read more about SSL handshake:
I think the conversation round-trip may worry you as well as packet sizes.
Once handshake phase is finished and connection is reused (keepalive) only HTTP data is sent, encrypted of course.
像这样:
like this: