vote up 3 vote down star
3

In previous jobs when I've worked on a Windows machine, I've used Fiddler for viewing HTTP transactions and debugging.

I'm specifically looking to monitor the HTTP transactions for an ajax site I'm working on to verify that the site is doing what I expect. Rewriting HTTP (as provided by Fiddler) is a nice-to-have, but not essential.

Can anybody recommend something similar for use on a Mac?

flag

79% accept rate

5 Answers

vote up 2 vote down

Not what you asked, but in Firefox the Live HTTP Headers add-on is all I need if I want to edit and re-play requests.

In Firebug, the Network Monitoring shows all requests and responses. Likewise, in Safari the Resources pane of the built-in Web Inspector covers most of my needs as well, but does not show the payload of POST Ajax/XHR requests (the responses are fine though). The latter has been fixed in the source code on August 31 2009, and some day will be updated in a new version of Safari. It might also apply to other browsers that use WebKit's inspector, such as Google Chrome. (Enable the Web Inspector through the preferences: Show Develop menu in menu bar.)

When things get more complicated, I fire up my Wireshark packet sniffer. However, unlike Fiddler, Wireshark does not let you change the data, and does not support things like auto responders, like Fiddler apparently does.

For Wireshark, see Hyper Text Transfer Protocol (HTTP) for some generic HTTP capturing information, and HTTP Packet Capturing to debug Apache, for some example display filters. (You may want to set the capture filter to "port 80", to show all requests to that port, and responses from that port. Or, to limit to some server, use capture filter "port 80 and host www.google.com".) Like:

# Show only 404: page not found
http.response.code == 404

# Show only certain HTTP methods
http.request.method == "POST" || http.request.method == "PUT"

# Show only javascript
http.content_type contains "javascript"

Note that Wireshark can decompress gzip or deflate encoded (compressed) things on the fly for you. That makes things much easier to read as most web servers will compress the data they send to a browser.

(As for auto responders: the excellent JS Bin has a short video on how to use it to debug Ajax requests. If you don't know JS Bin, then first view the introduction video.)

link|flag
+1 for Firebug -- I love their network monitoring tool – Josh Sep 21 at 23:15
vote up 1 vote down

My favorite mac app for monitoring traffic is HTTPScoop, I detail that as well as using tcpdump from the commandline in this post I blogged last year.

link|flag
If you happen to know Wireshark (or the less powerful Cocoa Packet Analyzer): can you compare HTTPScoop to that? – Arjan van Bentem Sep 18 at 11:09
It's quite a bit simpler, but much easier to use than wireshark IMO. Very easy to fire up and monitor http traffic with, but less adept at monitoring other kinds of traffic. I'm not familiar with cocoa packet analyzer. – tednaleid Sep 18 at 13:18
Cocoa Packet Analyzer is quite simple too. However, I never figured out how to filter some specific port or server IP address, and then see both the request and reply... That's easily done in Wireshark. (Just type smtp as display filter to see all traffic that uses the SMTP protocol. Or tcp.port == 25 to get all traffic to port 25, and its responses. Or http and ip.addr == xxx to get all HTTP traffic to and from some server.) – Arjan van Bentem Sep 19 at 8:24
vote up 0 vote down check

I found Charles Proxy. It's much closer to the functionality of Fiddler. It's not free, but it may be worth the price.

link|flag
Just curious: did anyone here ever use it? – Arjan van Bentem Sep 18 at 11:07
I used it for an hour or two after I found it. The trial version has some nag screens and a 30 minute restriction, but I don't think those are unreasonable. I was looking for specific headers in the HTTP response and I was able to see these easily. – Doug Harris Sep 18 at 18:11
FWIW, you can use Fiddler to debug Mac traffic if you have a Windows machine handy. fiddler2.com/fiddler/help/hookup.asp#Q-NonWindows – EricLaw -MSFT- Nov 5 at 16:19
vote up 0 vote down

I'm late but - I use Paros Proxy. It's in Java, so, cross-platform. Though if you would prefer for it to be packaged as an app, there's one here at the bottom.

link|flag
vote up 0 vote down

It seems that the free GlimmerBlocker can do part of the trick.

Of course it can block all kind of content, and transform responses before the browser receives them. But it can in fact modify both requests and responses. And though not true debugging, it also offers logging. So, it might suit basic needs:

There are 4 types of scripts running inside GlimmerBlocker, and some objects are only defined for some of the script types:

  • global proxy: this sets the global proxy settings, and can test for e.g. location name, AirPort network.
  • request modification: this can change the requested URL, send back a redirect response to the browser, or send text/html back to the browser.
  • keyword expansion. [Safari-only, AvB]
  • transform: modify the response received by the web-server before it is sent back to Safari [or any browser that is set up to use the proxy provided by GlimmerBlocker, AvB].

(One can also use it to include various Greasemonkey scripts in the received response, without using a Greasemonkey add-on, like to block Flash without installing any add-on.)

link|flag
GlimmerBlocker is an interesting tool, but different than what I'm looking for. I've re-edited the original description to remove the rewrite examples and clarify that I'm merely looking to monitor the traffic and not transform it. – Doug Harris Jan 7 at 16:46

Your Answer

Get an OpenID
or
never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.