<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Tohir Solomons &#187; debug</title>
	<atom:link href="http://www.tohir.co.za/tag/debug/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tohir.co.za</link>
	<description></description>
	<lastBuildDate>Fri, 11 Mar 2011 09:30:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>Getting started with Wireshark, the Fiddler for Ubuntu</title>
		<link>http://www.tohir.co.za/2010/02/01/getting-started-with-wireshark-the-fiddler-for-ubuntu/</link>
		<comments>http://www.tohir.co.za/2010/02/01/getting-started-with-wireshark-the-fiddler-for-ubuntu/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 07:38:59 +0000</pubDate>
		<dc:creator>Tohir</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software and Technology]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[fiddler]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[wireshark]]></category>

		<guid isPermaLink="false">http://www.tohir.co.za/?p=349</guid>
		<description><![CDATA[Fiddler is a useful tool for tracking http requests and responses. It&#8217;s similar to the Net tag in Firebug, except that it can be used to track all requests, not only browser-based ones. For Ubuntu users, the recommended alternative is Wireshark. Wireshark is noted as being more powerful than Fiddler, but the focus will be [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.fiddler2.com/fiddler2/">Fiddler</a> is a useful tool for tracking http requests and responses. It&#8217;s similar to the Net tag in Firebug, except that it can be used to track all requests, not only browser-based ones.</p>
<p>For Ubuntu users, the recommended alternative is <a href="http://www.wireshark.org/">Wireshark</a>. Wireshark is noted as being more powerful than Fiddler, but the focus will be on the features most commonly used by web developers for tracking.</p>
<h2>Installation</h2>
<p>Wireshark is found in the Ubuntu repositories, so simply search for <strong>wireshark</strong> in Synaptic, or enter <em>sudo apt-get install wireshark</em></p>
<h2>Usage</h2>
<p>Under Applications &gt; Internet, you will notice there are two options. Wireshark and Wireshark (as root). Run the second one (as root) as this gives you more data to track.</p>
<p><a href="http://www.tohir.co.za/wp-content/uploads/2010/01/wireshark-1.png"><img class="alignnone size-full wp-image-357" title="wireshark-1" src="http://www.tohir.co.za/wp-content/uploads/2010/01/wireshark-1.png" alt="wireshark-1" width="399" height="92" /></a></p>
<p>After wireshark has started, the process is straightforward:</p>
<ol>
<li>Choose which network interfaces to capture traffic from</li>
<li>Start capturing</li>
<li>Filter captured requests</li>
</ol>
<p>1. Choosing which network interfaces to capture traffic from. From the menu, choose: Capture &gt; Interfaces</p>
<p><a href="http://www.tohir.co.za/wp-content/uploads/2010/02/wireshark-2.png"><img class="alignnone size-full wp-image-358" title="wireshark-2" src="http://www.tohir.co.za/wp-content/uploads/2010/02/wireshark-2.png" alt="wireshark-2" width="745" height="272" /></a></p>
<p>This will bring up a list of network devices.</p>
<p>2. Since my work involves debugging work off my laptop (http://localhost etc), I only start device <strong>lo</strong> (127.0.0.1). This is useful as it immediately ignores all other traffic.</p>
<p>3. The one thing you will notice is that fiddler will log both the TCP and HTTP requests. For the purpose of debugging AJAX, etc., we are only interested in HTTP requests, TCP requests are not required. These can be hidden by adding a filter.</p>
<p><a href="http://www.tohir.co.za/wp-content/uploads/2010/02/wireshark-3.png"><img class="alignnone size-full wp-image-359" title="wireshark-3" src="http://www.tohir.co.za/wp-content/uploads/2010/02/wireshark-3.png" alt="wireshark-3" width="861" height="327" /></a></p>
<p>In the field next to Filter:, enter http and click on Apply.</p>
<p><a href="http://www.tohir.co.za/wp-content/uploads/2010/02/wireshark-4.png"><img class="alignnone size-full wp-image-360" title="wireshark-4" src="http://www.tohir.co.za/wp-content/uploads/2010/02/wireshark-4.png" alt="wireshark-4" width="715" height="213" /></a></p>
<p>The steps will now show all traffic coming on 127.0.0.1 via HTTP. The last step is picking up the AJAX parts for debugging. Notice that for each request, there is a response. Unlike Fiddler, Wireshark does not combine the request and the response. So click on the response line, and then expand the <strong>Line-based text data row</strong>. This will show the text of the AJAX response.</p>
<p><a href="http://www.tohir.co.za/wp-content/uploads/2010/02/wireshark-5.png"><img class="alignnone size-full wp-image-361" title="wireshark-5" src="http://www.tohir.co.za/wp-content/uploads/2010/02/wireshark-5.png" alt="wireshark-5" width="693" height="569" /></a></p>
<h3>Conclusion</h3>
<p>Wireshark takes more steps than Fiddler, and Fiddler is a more focussed program than Wireshark. Wireshark also captures traffic without having to install a plugin into firefox, etc., so it&#8217;s useful for debugging applications as well. The biggest improvement to make Wireshark truly replace Fiddler is to turn off truncation of the response text. Wish I knew how!</p>
<p><map name='google_ad_map_349_d66c8ad2bfa7c2ab'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/349?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_349_d66c8ad2bfa7c2ab' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=349&amp;url= http%3A%2F%2Fwww.tohir.co.za%2F2010%2F02%2F01%2Fgetting-started-with-wireshark-the-fiddler-for-ubuntu%2F' /></p>]]></content:encoded>
			<wfw:commentRss>http://www.tohir.co.za/2010/02/01/getting-started-with-wireshark-the-fiddler-for-ubuntu/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

