分析我的java代码发送的http流量的最佳方法? [英] Best way to analyze http traffic sent by my java code?

查看:196
本文介绍了分析我的java代码发送的http流量的最佳方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些新的Java代码(使用Apache commons http库)和旧的(严格使用java 1.4 API),并尝试使用较新的apache commons库重写旧代码。然而,它不起作用,我正在努力找出原因。请求正在发送,但我的新代码在我无法访问的接收服务器上超时。由于旧代码有效,我必须搞砸http请求。使用某种HTTP流量嗅探器来检查发送的内容是非常有用的,这样我就能看出它们之间存在什么差异。

I have some java code both new (using Apache commons http libraries) and old (strictly using java 1.4 API) and am trying to rewrite the old code using the newer apache commons libraries. However, it isn't working and I'm struggling to find out why. The requests are being sent, but my newer code times out on the receiving server which I don't have access to. Since the old code works, I must have mucked up the http request. It would be very useful to use some sort of HTTP traffic sniffer to examine exactly what is being sent so I can see what differences there are.

我从网上下载了一些http嗅探器(这一个那一个)但都没有捕获任何http数据由我的java代码发送(但是当我从浏览器发送随机请求时它们确实有效)。关于我如何掌握这些数据的任何想法?

I've downloaded a few http sniffers from the web (this one and that one) but neither capture any of the http data being sent by my java code (but they do work when I send random requests from a browser). Any ideas out there on how I can get my hands on this data?

推荐答案

使用 wireshark

这是伟大的,免费的,开源的,跨平台的,可以突出显示不同的网络层,它不是从一些看起来像SEO垃圾邮件的可疑网站运行。

It's great, free, open-source, cross-platform, and can highlight different network layers, and it's not running from some dubious website that looks like SEO spam.

Snort 是另一个好的,但它更倾向于入侵检测和自动响应。不过,它有一个很棒的嗅探器。

Snort is another good one, but it's more geared toward intrusion detection and automated responses to that. Still, it has a great sniffer.

这篇关于分析我的java代码发送的http流量的最佳方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆