<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Internet Explorer Support Tools and Debugging</title><link>http://blogs.msdn.com/emmanubo/default.aspx</link><description /><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Improved version of STRACE and HTTPREPLAY</title><link>http://blogs.msdn.com/emmanubo/archive/2008/04/02/improved-version-of-strace-and-httpreplay.aspx</link><pubDate>Wed, 02 Apr 2008 16:59:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8351506</guid><dc:creator>emmanubo</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/emmanubo/comments/8351506.aspx</comments><wfw:commentRss>http://blogs.msdn.com/emmanubo/commentrss.aspx?PostID=8351506</wfw:commentRss><description>&lt;P&gt;New version of STRACE and HTTPREPLAY have been posted on Microsoft's download center :&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://www.microsoft.com/downloads/details.aspx?familyid=d25ba362-c17b-4d80-a677-1faff862e629&amp;amp;displaylang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?familyid=d25ba362-c17b-4d80-a677-1faff862e629&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?familyid=d25ba362-c17b-4d80-a677-1faff862e629&amp;amp;displaylang=en&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://www.microsoft.com/downloads/details.aspx?familyid=F5EC767F-27F2-4FB3-90A5-4BF0D5F4810A&amp;amp;displaylang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?familyid=F5EC767F-27F2-4FB3-90A5-4BF0D5F4810A&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?familyid=F5EC767F-27F2-4FB3-90A5-4BF0D5F4810A&amp;amp;displaylang=en&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;In addition to a couple of fixes, the following features have been added to HTTPREPLAY :&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Fiddler (&lt;A href="http://www.fiddlertool.com/fiddler/" mce_href="http://www.fiddlertool.com/fiddler/"&gt;http://www.fiddlertool.com/fiddler/&lt;/A&gt;) traces can&amp;nbsp;be replayed&lt;/LI&gt;
&lt;LI&gt;both HTTP requests and responses are extracted from a STRACE log (/XTRACT switch)&lt;/LI&gt;
&lt;LI&gt;the SENDFILE utility provided can be used to replay a request (like, for example, a large POST request)&lt;/LI&gt;
&lt;LI&gt;new flag (/D:port /H:host ) can be used to route unresolvable requests to a specific host/post &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;When used with latest version of STRACE, HTTPREPLAY&amp;nbsp;can also detect transport related issue (ex : TCP RESET upon send/receive). Such issues will be highlighted in the HTTPREPLAY report :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;STRONG&gt;Socket errors :&lt;/STRONG&gt; &lt;BR&gt;&lt;BR&gt;
&lt;TABLE class="" border=1&gt;
&lt;COLGROUP&gt;
&lt;COL width="75%"&gt;&lt;/COL&gt;
&lt;COL width="25%"&gt;&lt;/COL&gt;&lt;/COLGROUP&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class=""&gt;14:08:22:790 - recv() failed / socket = 0x00000058 / WSAGetLastError = 0x00002746 (An existing connection was forcibly closed by the remote host. ) &lt;/TD&gt;
&lt;TD class="" align=middle&gt;strace.log (line 25111)&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=""&gt;14:08:35:446 - recv() failed / socket = 0x000001a0 / WSAGetLastError = 0x00002746 (An existing connection was forcibly closed by the remote host. ) &lt;/TD&gt;
&lt;TD class="" align=middle&gt;strace.log (line 26606)&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=""&gt;14:08:49:775 - recv() failed / socket = 0x00000018 / WSAGetLastError = 0x00002746 (An existing connection was forcibly closed by the remote host. ) &lt;/TD&gt;
&lt;TD class="" align=middle&gt;strace.log (line 30266)&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=""&gt;14:08:49:775 - recv() failed / socket = 0x00000578 / WSAGetLastError = 0x00002746 (An existing connection was forcibly closed by the remote host. ) &lt;/TD&gt;
&lt;TD class="" align=middle&gt;strace.log (line 30269)&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=""&gt;14:10:13:354 - send() failed / socket = 0x00000020 / WSAGetLastError = 0x00002746 (An existing connection was forcibly closed by the remote host. ) &lt;/TD&gt;
&lt;TD class="" align=middle&gt;strace.log (line 38757)&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR&gt;&lt;BR&gt;&lt;B&gt;Statistics :&lt;/B&gt; &lt;BR&gt;&lt;BR&gt;
&lt;TABLE class=""&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="" colSpan=2&gt;
&lt;HR&gt;
&lt;/TD&gt;
&lt;TR&gt;
&lt;TD class=""&gt;Request(s)&lt;/TD&gt;
&lt;TD class="" align=right&gt;14&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=""&gt;Unique request(s)&lt;/TD&gt;
&lt;TD class="" align=right&gt;9&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" colSpan=2&gt;
&lt;HR&gt;
&lt;/TD&gt;
&lt;TR&gt;
&lt;TD class=""&gt;&lt;B&gt;FAILED request(s)&lt;/B&gt;&lt;/TD&gt;
&lt;TD class="" align=right&gt;5&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=""&gt;&lt;B&gt;Socket error(s)&lt;/B&gt;&lt;/TD&gt;
&lt;TD class="" align=right&gt;5&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" colSpan=2&gt;
&lt;HR&gt;
&lt;/TD&gt;
&lt;TR&gt;
&lt;TD class=""&gt;POST&lt;/TD&gt;
&lt;TD class="" align=right&gt;2&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=""&gt;GET&lt;/TD&gt;
&lt;TD class="" align=right&gt;12&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" colSpan=2&gt;
&lt;HR&gt;
&lt;/TD&gt;
&lt;TR&gt;
&lt;TD class=""&gt;HTTP 200&lt;/TD&gt;
&lt;TD class="" align=right&gt;7&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=""&gt;HTTP 301&lt;/TD&gt;
&lt;TD class="" align=right&gt;2&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" colSpan=2&gt;
&lt;HR&gt;
&lt;/TD&gt;
&lt;TR&gt;
&lt;TD class=""&gt;Connection(s)&lt;/TD&gt;
&lt;TD class="" align=right&gt;7&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=""&gt;Maximum simultaneous connection(s)&lt;/TD&gt;
&lt;TD class="" align=right&gt;2&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=""&gt;Byte(s) sent&lt;/TD&gt;
&lt;TD class="" align=right&gt;60019&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=""&gt;Byte(s) received&lt;/TD&gt;
&lt;TD class="" align=right&gt;21092&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=""&gt;Average response time (ms)&lt;/TD&gt;
&lt;TD class="" align=right&gt;867&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=""&gt;Max response time (ms)&lt;/TD&gt;
&lt;TD class="" align=right&gt;3047 (&lt;A href="file:///C:/Documents%20and%20Settings/emmanubo/Desktop/HTTPREPLAY.HTM#ID11" mce_href="file:///C:/Documents%20and%20Settings/emmanubo/Desktop/HTTPREPLAY.HTM#ID11"&gt;ID 11&lt;/A&gt;)&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" colSpan=2&gt;
&lt;HR&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8351506" width="1" height="1"&gt;</description></item><item><title>Using STRACE and HTTPREPLAY with Firefox</title><link>http://blogs.msdn.com/emmanubo/archive/2007/12/19/using-strace-and-httpreplay-with-firefox.aspx</link><pubDate>Wed, 19 Dec 2007 12:26:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6805086</guid><dc:creator>emmanubo</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/emmanubo/comments/6805086.aspx</comments><wfw:commentRss>http://blogs.msdn.com/emmanubo/commentrss.aspx?PostID=6805086</wfw:commentRss><description>&lt;P&gt;Some people have asked&amp;nbsp;me if the STRACE and&amp;nbsp;HTTPREPLAY tools can be used with other browsers than Internet Explorer like Mozilla Firefox. The answer to this question is "Yes". You can&amp;nbsp;generate a STRACE log with Firefox by creating the&amp;nbsp;following batch file (straceff.cmd) file in the c:\program files\strace directory :&lt;/P&gt;
&lt;P&gt;@echo off&lt;BR&gt;set FFPATH="%programfiles%\Mozilla Firefox\firefox.exe"&lt;BR&gt;set STRACEDLL=STRACE.DLL_IE6&lt;BR&gt;runelevate withdll /d:%STRACEDLL% %FFPATH% about:blank&lt;/P&gt;
&lt;P&gt;Running the above batch will create a STRACE log that you can subsequently use with HTTPREPLAY. This allows to do funny things&amp;nbsp;like generating&amp;nbsp;a STRACE log using&amp;nbsp;Firefox and replay it with Internet Explorer (or the opposite)... Note that, since FireFox relies on his own SSL layer (it doesn't use the EncryptMessage/DecryptMessage APIs),&amp;nbsp;STRACE logs generated using Firefox&amp;nbsp;only contain clear text HTTP.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6805086" width="1" height="1"&gt;</description></item><item><title>SOCKTRC tool</title><link>http://blogs.msdn.com/emmanubo/archive/2007/08/03/socktrc-tool.aspx</link><pubDate>Fri, 03 Aug 2007 15:56:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4207882</guid><dc:creator>emmanubo</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/emmanubo/comments/4207882.aspx</comments><wfw:commentRss>http://blogs.msdn.com/emmanubo/commentrss.aspx?PostID=4207882</wfw:commentRss><description>&lt;P&gt;The SOCKTRC&amp;nbsp;command line utility which is part of the HTTPREPLAY tool is a&amp;nbsp;"socket based proxy". Some&amp;nbsp;people also call such utility a "socket listener". I wrote this tool long time ago mainly to troubleshoot HTTP issues but the tool can also be used to trace any TCP&amp;nbsp;based protocol such as SMTP, POP3..etc.&amp;nbsp; In addition to being a socket listener, the tool implements the&amp;nbsp;following features :&lt;BR&gt;&lt;BR&gt;- display &amp;amp; filtering capabilities&lt;BR&gt;- change data on the fly &lt;BR&gt;- simulate slow speed connection&lt;BR&gt;- extensible architecture through simple extension DLL &lt;/P&gt;
&lt;P&gt;Let's take a deeper look at the tool...&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Using&amp;nbsp;SOCKTRC&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;For HTTP troubleshooting, the tool can be used using 2 different methods :&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;U&gt;Method #1 - Use SOCKTRC to remote a web&amp;nbsp;server (or any TCP based server like SMTP,POP...etc)&lt;BR&gt;&lt;BR&gt;&lt;/U&gt;From the command prompt, run "SOCKTRC /S:80 /D:80 /OS /OD /V /H:mywebserver". Congratulations! You now have a new web site available on your machine. To dump the traffic between IE and mywebserver, run Internet Explorer and connect to "http://localhost". Note that if you already have a local web server, you'll need to use another port than 80 (ex. : run "SOCKTRC /S:&lt;U&gt;82&lt;/U&gt; /D:80 /OS /OD /V /H:mywebserver" and use "http://localhost:&lt;U&gt;82&lt;/U&gt;" as the URL). Of course this method will only work as long as the hyperlinks used are relatives since clicking on a&amp;nbsp;URL like&amp;nbsp;http://&lt;A href="http://www.microsoft.com/" mce_href="http://www.microsoft.com/"&gt;www.microsoft.com&lt;/A&gt; will completely "bypass" the tool...&lt;BR&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;U&gt;Method #2 - SOCKTRC as HTTP proxy server&lt;BR&gt;&lt;BR&gt;&lt;/U&gt;Assuming TCP port 80 is not used, run "SOCKTRC /S:80 /D:80 /OS /OD /V /H:myhttpproxy". You can then run Internet Explorer and set localhost:80 as your HTTP proxy server (ensure IE option "Bypass proxy for local addresses" is *not* checked). Once this has been done, all traffic will be dumped by SOCKTRC regardless of the URLs accessed&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If you want to trace non HTTP protocols like SMTP, POP..etc only method 1 can be used.&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Customizing trace output&lt;/STRONG&gt;&lt;/U&gt; &lt;BR&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;By default, SOCKTRC just displays a summary of the data sent/received. For example, running "SOCKTRC /S:80 /D:80 /H:MYWEBSERVER" and connecting with IE to "http://localhost" will result in the following display :&lt;BR&gt;&lt;BR&gt;SOCKTRC /S:80 /D:80 /H:MYWEBSERVER&lt;/P&gt;
&lt;P&gt;11:41:34:057 ==================================================================&lt;BR&gt;11:41:34:057 Protocol : TCP&lt;BR&gt;11:41:34:057 Source port : 80&lt;BR&gt;11:41:34:057 Bind on adapter : INADDR_ANY&lt;BR&gt;11:41:34:057 Destination port : 80&lt;BR&gt;11:41:34:057 Destination host : MYWEBSERVER&lt;BR&gt;11:41:34:057 ==================================================================&lt;BR&gt;Press to exit.&lt;BR&gt;11:41:37:159 #0 - New connection accepted (127.0.0.1:3387)&lt;BR&gt;11:41:37:174 #0 - 127.0.0.1:3387 -&amp;gt; :80 (377 bytes / total : 377 bytes) :3388 -&amp;gt; MYWEBSERVER:80&lt;BR&gt;11:41:42:516 #0 - 127.0.0.1:3387 &amp;lt;- :80 (4096 bytes / total : 4096 bytes) :3388 &amp;lt;- MYWEBSERVER:80&lt;BR&gt;11:41:42:516 #0 - 127.0.0.1:3387 &amp;lt;- :80 (593 bytes / total : 4689 bytes) :3388 &amp;lt;- MYWEBSERVER:80&lt;BR&gt;11:41:42:516 #0 - 127.0.0.1:3387 -&amp;gt; :80 (463 bytes / total : 840 bytes) :3388 -&amp;gt; MYWEBSERVER:80&lt;BR&gt;11:41:43:064 #0 - 127.0.0.1:3387 &amp;lt;- :80 (4096 bytes / total : 8785 bytes) :3388 &amp;lt;- MYWEBSERVER:80&lt;BR&gt;11:41:43:064 #0 - 127.0.0.1:3387 &amp;lt;- :80 (504 bytes / total : 9289 bytes) :3388 &amp;lt;- MYWEBSERVER:80&lt;BR&gt;11:41:43:064 #0 - 127.0.0.1:3387 -&amp;gt; :80 (615 bytes / total : 1455 bytes) :3388 -&amp;gt; MYWEBSERVER:80&lt;BR&gt;11:41:43:299 #0 - 127.0.0.1:3387 &amp;lt;- :80 (359 bytes / total : 9648 bytes) :3388 &amp;lt;- MYWEBSERVER:80&lt;BR&gt;11:41:43:330 #0 - 127.0.0.1:3387 -&amp;gt; :80 (493 bytes / total : 1948 bytes) :3388 -&amp;gt; MYWEBSERVER:80&lt;BR&gt;11:41:43:518 #0 - 127.0.0.1:3387 &amp;lt;- :80 (4096 bytes / total : 13744 bytes) :3388 &amp;lt;- MYWEBSERVER:80&lt;BR&gt;...&lt;/P&gt;
&lt;P&gt;To get all the data displayed use "/OS" (dump data from client) "/OD" (dump data from server) and "/V" to display all data in hex format :&lt;BR&gt;&lt;BR&gt;SOCKTRC /S:80 /D:80 /H:MYWEBSERVER /OS /OD /V&lt;BR&gt;...&lt;BR&gt;12:26:31:401 #0 - New connection accepted (127.0.0.1:3784)&lt;BR&gt;12:26:31:401 #0 - 127.0.0.1:3784 -&amp;gt; :80 (269 bytes / total : 269 bytes) :3785 -&amp;gt; MYWEBSERVER:80&lt;/P&gt;
&lt;P&gt;=&amp;gt; ==================================================================&lt;BR&gt;00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 0123456789abcdef&lt;/P&gt;
&lt;P&gt;0000: 47 45 54 20 2f 20 48 54 54 50 2f 31 2e 31 0d 0a GET / HTTP/1.1..&lt;BR&gt;0010: 41 63 63 65 70 74 3a 20 2a 2f 2a 0d 0a 41 63 63 Accept: */*..Acc&lt;BR&gt;0020: 65 70 74 2d 4c 61 6e 67 75 61 67 65 3a 20 65 6e ept-Language: en&lt;BR&gt;0030: 2d 75 73 0d 0a 41 63 63 65 70 74 2d 45 6e 63 6f -us..Accept-Enco&lt;BR&gt;0040: 64 69 6e 67 3a 20 67 7a 69 70 2c 20 64 65 66 6c ding: gzip, defl&lt;BR&gt;0050: 61 74 65 0d 0a 55 73 65 72 2d 41 67 65 6e 74 3a ate..User-Agent:&lt;BR&gt;0060: 20 4d 6f 7a 69 6c 6c 61 2f 34 2e 30 20 28 63 6f Mozilla/4.0 (co&lt;BR&gt;0070: 6d 70 61 74 69 62 6c 65 3b 20 4d 53 49 45 20 36 mpatible; MSIE 6&lt;BR&gt;0080: 2e 30 3b 20 57 69 6e 64 6f 77 73 20 4e 54 20 35 .0; Windows NT 5&lt;BR&gt;0090: 2e 31 3b 20 2e 4e 45 54 20 43 4c 52 20 31 2e 30 .1; .NET CLR 1.0&lt;BR&gt;00a0: 2e 33 37 30 35 29 0d 0a 48 6f 73 74 3a 20 6c 6f .3705)..Host: lo&lt;BR&gt;00b0: 63 61 6c 68 6f 73 74 3a 38 32 0d 0a 43 6f 6e 6e calhost:82..Conn&lt;BR&gt;00c0: 65 63 74 69 6f 6e 3a 20 4b 65 65 70 2d 41 6c 69 ection: Keep-Ali&lt;BR&gt;00d0: 76 65 0d 0a 43 6f 6f 6b 69 65 3a 20 41 53 50 53 ve..Cookie: ASPS&lt;BR&gt;00e0: 45 53 53 49 4f 4e 49 44 47 47 51 51 47 4b 57 47 ESSIONIDGGQQGKWG&lt;BR&gt;00f0: 3d 4f 43 4b 4e 45 4e 48 43 49 42 44 46 4b 47 42 =OCKNENHCIBDFKGB&lt;BR&gt;0100: 50 4b 45 4d 46 46 4a 43 43 0d 0a 0d 0a PKEMFFJCC....&lt;BR&gt;==================================================================&lt;BR&gt;12:26:31:401 #0 - 127.0.0.1:3784 &amp;lt;- :82 (1544 bytes / total : 1544 bytes) :3785 &amp;lt;- MYWEBSERVER:80&lt;/P&gt;
&lt;P&gt;=&amp;gt; ==================================================================&lt;BR&gt;00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 0123456789abcdef&lt;/P&gt;
&lt;P&gt;0000: 48 54 54 50 2f 31 2e 31 20 32 30 30 20 4f 4b 0d HTTP/1.1 200 OK.&lt;BR&gt;0010: 0a 53 65 72 76 65 72 3a 20 4d 69 63 72 6f 73 6f .Server: Microso&lt;BR&gt;0020: 66 74 2d 49 49 53 2f 35 2e 31 0d 0a 44 61 74 65 ft-IIS/5.1..Date&lt;BR&gt;0030: 3a 20 57 65 64 2c 20 30 34 20 53 65 70 20 32 30 : Wed, 04 Sep 20&lt;BR&gt;0040: 30 32 20 31 30 3a 32 36 3a 33 31 20 47 4d 54 0d 02 10:26:31 GMT.&lt;BR&gt;0050: 0a 43 6f 6e 74 65 6e 74 2d 4c 65 6e 67 74 68 3a .Content-Length:&lt;BR&gt;0060: 20 31 33 39 30 0d 0a 43 6f 6e 74 65 6e 74 2d 54 1390..Content-T&lt;BR&gt;0070: 79 70 65 3a 20 74 65 78 74 2f 68 74 6d 6c 0d 0a ype: text/html..&lt;BR&gt;0080: 43 61 63 68 65 2d 63 6f 6e 74 72 6f 6c 3a 20 70 Cache-control: p&lt;BR&gt;0090: 72 69 76 61 74 65 0d 0a 0d 0a 3c 68 74 6d 6c 3e rivate....&lt;BR&gt;00a0: 20 0d 0a 20 20 0d 0a 3c 68 65 61 64 3e 0d 0a 3c .. ....&amp;lt;&lt;BR&gt;00b0: 6c 69 6e 6b 20 74 79 70 65 3d 27 74 65 78 74 2f link type='text/&lt;BR&gt;00c0: 78 6d 6c 27 20 72 65 6c 3d 27 61 6c 74 65 72 6e xml' rel='altern&lt;BR&gt;00d0: 61 74 65 27 20 68 72 65 66 3d 27 2f 44 65 66 61 ate' href='/Defa&lt;BR&gt;...&lt;BR&gt;&lt;BR&gt;To display only the first 100 bytes of client data, use "/OS:100" :&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;SOCKTRC /S:80 /D:80 /H:MYWEBSERVER /OS:100&lt;BR&gt;...&lt;BR&gt;12:33:58:693 #0 - New connection accepted (127.0.0.1:3819)&lt;BR&gt;12:33:58:693 #0 - 127.0.0.1:3819 -&amp;gt; :82 (269 bytes / total : 269 bytes) :3820 -&amp;gt; MYWEBSERVER:80&lt;/P&gt;
&lt;P&gt;=&amp;gt;GET / HTTP/1.1..Accept: */*..Accept-Language: en-us..Accept-Encoding: gzip, deflate..User-Agent: Moz&lt;BR&gt;12:33:58:708 #0 - 127.0.0.1:3819 &amp;lt;- :82 (1544 bytes / total : 1544 bytes) :3820 &amp;lt;- MYWEBSERVER:80&lt;BR&gt;12:33:58:708 #0 - 127.0.0.1:3819 -&amp;gt; :82 (413 bytes / total : 682 bytes) :3820 -&amp;gt; MYWEBSERVER:80&lt;/P&gt;
&lt;P&gt;=&amp;gt;GET /_themes/artsy/arts1011.css HTTP/1.1..Accept: */*..Referer: &lt;A href="http://localhost..accept-language/" mce_href="http://localhost..accept-language/"&gt;http://localhost..Accept-Language&lt;/A&gt;&lt;BR&gt;12:33:58:708 #0 - 127.0.0.1:3819 &amp;lt;- :82 (141 bytes / total : 1685 bytes) :3820 &amp;lt;- MYWEBSERVER:80&lt;BR&gt;12:33:58:740 #0 - 127.0.0.1:3819 -&amp;gt; :82 (441 bytes / total : 1123 bytes) :3820 -&amp;gt; MYWEBSERVER:80&lt;/P&gt;
&lt;P&gt;=&amp;gt;GET /default.asp HTTP/1.1..Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application&lt;BR&gt;12:33:58:755 #0 - 127.0.0.1:3819 &amp;lt;- :82 (2291 bytes / total : 3976 bytes) :3820 &amp;lt;- MYWEBSERVER:80&lt;BR&gt;12:33:58:755 #1 - New connection accepted (127.0.0.1:3821)&lt;BR&gt;12:33:58:755 #1 - 127.0.0.1:3821 -&amp;gt; :82 (439 bytes / total : 439 bytes) :3822 -&amp;gt; MYWEBSERVER:80&lt;/P&gt;
&lt;P&gt;=&amp;gt;GET /navbar.asp HTTP/1.1..Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/v&lt;BR&gt;12:33:58:755 #1 - 127.0.0.1:3821 &amp;lt;- :82 (1444 bytes / total : 1444 bytes) :3822 &amp;lt;- MYWEBSERVER:80&lt;BR&gt;12:33:58:755 #0 - 127.0.0.1:3819 -&amp;gt; :82 (438 bytes / total : 1561 bytes) :3820 -&amp;gt; MYWEBSERVER:80&lt;BR&gt;&lt;FONT face=Terminal size=2&gt;&lt;BR&gt;&lt;/FONT&gt;To display only the 100 bytes sent by the server, just use "/OD:100" (this can be combined with /OS:100).&lt;BR&gt;&lt;BR&gt;It is also possible to filter the data displayed based on its contents. For example, you can display only "401" responses from server using "/HSS:401". Same filtering can be done on the client. For example, to only display POST request, use "/CSS:POST". &lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Other tips &amp;amp; tricks&lt;/STRONG&gt;&lt;/U&gt; &lt;BR&gt;&lt;BR&gt;
&lt;UL&gt;
&lt;LI&gt;SOCKTRC uses the ETC/SERVICES file so, assuming your SERVICES file is correctly populated, you can type something like : &lt;/LI&gt;&lt;/UL&gt;
&lt;BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;"SOCKTRC /s:HTTP /d:HTTP /os /od /v". This is usefull if you do not know all port numbers...&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BLOCKQUOTE&gt;
&lt;UL&gt;
&lt;LI&gt;SOCKTRC binds by default on INADDR_ANY. You can bind SOCKTRC on a specific network adapted using the "/B" option&lt;/LI&gt;
&lt;LI&gt;You can change data on the fly using the "/CSR:" (data from client) and "/HSR:" (data from server) flags. The following command changes "Cache-Control" to "Xache-Control" in all content sent by&amp;nbsp;MYWEBSERVER&amp;nbsp;:&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;"SOCKTRC /s:80 /d:80 /os /od /v /HSS:Cache-Control /HSR:Xache-Control /H:MYWEBSERVER".&lt;/P&gt;
&lt;P&gt;This feature can be usefull for testing purposes (for example, to adjust an invalid content-length or remove HTTP no-cache header). Note that in many cases, you have to&amp;nbsp;make sure that searched/replaced strings have the same length (to maintain&amp;nbsp;valid content-length or chunck size).&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;UL&gt;
&lt;LI&gt;When you search or replace data, you can specify binary data using hex format HxHH (example : "/CSS:0x610x620x63" is equivalent to "/CSS:abc")&lt;/LI&gt;
&lt;LI&gt;The "/F" flag can be used to display only the data coming from a specific client. (this is usefull if multiple machines are connecting to SOCKTRC source port as you may only be interested to do traces for one specific machine). &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face=Verdana&gt;&lt;U&gt;FAQ&lt;/U&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;Here is a small FAQ regarding the tool and issues you may get and hopefully resolve!&lt;/FONT&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;SOCKTRC arguments&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;
&lt;TABLE class=""&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="" colSpan=2&gt;SOCKTRC &amp;lt;/S:port&amp;gt; &amp;lt;/D:port&amp;gt; &amp;lt;/B:adapter&amp;gt; [/H:host] [/F:client] [/OS:n] [/OD:n] [/U] [/R] [/L:speed] [/V] &lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=""&gt;/S:sourceport&lt;/TD&gt;
&lt;TD class=""&gt;source port to use&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=""&gt;/D:destport&lt;/TD&gt;
&lt;TD class=""&gt;destination port to use (-1 to drop incoming data)&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=""&gt;/B:adapter&lt;/TD&gt;
&lt;TD class=""&gt;bind on adapter (IP/hostname)&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=""&gt;/H:host&lt;/TD&gt;
&lt;TD class=""&gt;destination IP/hostname&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=""&gt;/F:client&lt;/TD&gt;
&lt;TD class=""&gt;only output data to/from client&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=""&gt;/CSS:csstring&lt;/TD&gt;
&lt;TD class=""&gt;only output data from client containing csstring&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=""&gt;/CSR:csrstring&lt;/TD&gt;
&lt;TD class=""&gt;replace csstring by csrtring&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=""&gt;/HSS:hsstring&lt;/TD&gt;
&lt;TD class=""&gt;only output data from destination containg hsstring&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=""&gt;/HSR:hsrstring&lt;/TD&gt;
&lt;TD class=""&gt;replace hsstring by hsrstring&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=""&gt;/OS[:n]&lt;/TD&gt;
&lt;TD class=""&gt;output [n] characters sent by source&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=""&gt;/OD[:n]&lt;/TD&gt;
&lt;TD class=""&gt;output [n] characters sent by destination&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=""&gt;/U&lt;/TD&gt;
&lt;TD class=""&gt;use UDP (by default, TCP is used)&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=""&gt;/R&lt;/TD&gt;
&lt;TD class=""&gt;resolve client IP address&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=""&gt;/L:speed&lt;/TD&gt;
&lt;TD class=""&gt;simulate a speed bps connection&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=""&gt;/PC:sleepdelay&lt;/TD&gt;
&lt;TD class=""&gt;sleep x ms before sending to source&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=""&gt;/PH:speeddelay&lt;/TD&gt;
&lt;TD class=""&gt;sleep x ms before sending to destination&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=""&gt;/MC:buffersize&lt;/TD&gt;
&lt;TD class=""&gt;use buffersize for recv from client&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=""&gt;/MH:buffersize&lt;/TD&gt;
&lt;TD class=""&gt;use buffersize for recv from destination&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=""&gt;/N:string&lt;/TD&gt;
&lt;TD class=""&gt;decode BASE64 data located after string&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=""&gt;/V&lt;/TD&gt;
&lt;TD class=""&gt;verbose (hexadecimal) output&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=""&gt;/T&lt;/TD&gt;
&lt;TD class=""&gt;silent mode (minimum output)&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=""&gt;/I&lt;/TD&gt;
&lt;TD class=""&gt;install as a service&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=""&gt;/Z&lt;/TD&gt;
&lt;TD class=""&gt;remove service&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=""&gt;/X&lt;/TD&gt;
&lt;TD class=""&gt;only allow incoming connection from local machine&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class=""&gt;/E:DLL&lt;/TD&gt;
&lt;TD class=""&gt;load DLL extension&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" colSpan=2&gt;&lt;BR&gt;Examples : &lt;BR&gt;&lt;BR&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" colSpan=2&gt;socktrc /s:http /d:http /h:www.ibm.com /os:40 /v&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" colSpan=2&gt;socktrc /s:dns /d:dns /h:mydnsserver /os /od /v /u /r&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" colSpan=2&gt;socktrc /s:82 /d:80 /h:myproxy /os /od /v /r /n:NTLM0x20&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;&lt;U&gt;&lt;STRONG&gt;When I run SOCKTRC, I get the following error : "ListeningThread : error on bind() : 10048"&lt;/STRONG&gt;&lt;/U&gt;&lt;BR&gt;&lt;BR&gt;This occurs because the source port (/S:portnumber) specified is already bound by another application (for example IIS). You can solve the issue by either using a different source port for SOCKTRC or change the port used by the other application (IIS). &lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;
&lt;P dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;U&gt;&lt;STRONG&gt;What is a SOCKTRC DLL extension and how to write one ?&lt;/STRONG&gt;&lt;/U&gt;&lt;BR&gt;&lt;BR&gt;SOCKTRC can call a custom extension DLL whenever data is sent/received.This allows the extension to&amp;nbsp;filter or change data. The HTTPREPLAY tool is mainly built on this feature.&lt;/P&gt;
&lt;P&gt;An extension DLL just needs to export the following function :&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;//*************************************************************************&lt;BR&gt;// debug &amp;amp; dump functions provided by SOCKTRC&lt;BR&gt;//*************************************************************************&lt;BR&gt;typedef void DumpDataFunc(char *data, DWORD size,BOOL fromclient,DWORD ThreadIndex,BOOL DataDump);&lt;BR&gt;typedef void DebugMsgFunc(char *format,...);&lt;BR&gt;&lt;BR&gt;DumpDataFunc *gDumpData;&lt;BR&gt;DebugMsgFunc *gDebugMsg;&lt;BR&gt;&lt;BR&gt;//*************************************************************************&lt;BR&gt;// SocktrcExtInit&lt;BR&gt;//*************************************************************************&lt;BR&gt;DllExport SocktrcExtInit(int sourceport,int destport,DumpDataFunc *pfDumpData,DebugMsgFunc *pfDebugMsg)&lt;BR&gt;{&lt;BR&gt;gDumpData=pfDumpData;&lt;BR&gt;gDebugMsg=pfDebugMsg;&lt;BR&gt;gDebugMsg("Extension loaded...");&lt;BR&gt;...&lt;BR&gt;}&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;//*************************************************************************&lt;BR&gt;// SocktrcExt&lt;BR&gt;//&lt;BR&gt;// IP : client address&lt;BR&gt;// buffer : data received or sent&lt;BR&gt;// bufsize : size of buffer&lt;BR&gt;// from client : TRUE if data comes from the client, FALSE if data comes from the host&lt;BR&gt;// sock_client : client's socket&lt;BR&gt;// sock_server : server's (host) socket&lt;BR&gt;\*************************************************************************/&lt;BR&gt;DllExport BOOL SocktrcExt(char *ip,char *buffer,INT *bufsize,BOOL fromclient,SOCKET sock_client,SOCKET sock_server,DWORD ID)&lt;BR&gt;{&lt;BR&gt;...&lt;BR&gt;// add you filtering code here &lt;BR&gt;// the following line sends back data to the client and dumps it using the hex dump function provided by socktrc : &lt;BR&gt;send(sock_client,data,szdata,0);&lt;BR&gt;gDumpData(data,szdata,FALSE,ID,TRUE);&lt;BR&gt;...&lt;BR&gt;}&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;How does the /l option work ?&lt;/STRONG&gt;&lt;/U&gt;&lt;BR&gt;&lt;BR&gt;The /l option allows to introduce a "sleep delay" on send/receive of data. The sleep delay is implemented as follow : sleep delay (seconds) = BytesRead*8/linkSpeed &lt;BR&gt;&lt;BR&gt;If 4 kbytes are received and the "link speed" is set to 9600 (bps), the sleep delay will be 4096*8/9600=3.41 seconds. Once the sleep delay has terminated, the 4kb are sent. &lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Can I use SOCKTRC to remote a production web server ?&lt;/STRONG&gt;&lt;/U&gt;&lt;BR&gt;&lt;BR&gt;No! SOCKTRC is not designed to handle a large amount of clients. Whenever a new connection is done to SOCKTRC, 2 threads are created (one thread forwards data from client to server and the other thread does the opposite). This design prevents to handle a large amount of clients (more than 20 clients).&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;What is the purpose of the /X option ?&lt;/STRONG&gt;&lt;/U&gt;&lt;BR&gt;&lt;BR&gt;The /X option has been introduced to prevent remote incoming connections. This option is usefull if you want to avoid to proxy malware data&amp;nbsp;for example. Proxying malware&amp;nbsp;traffic could make think network administrators that your machine is infected by malware even if it isn't. By using the /X option, you only allow local application to connect to SOCKTRC. &lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;How do I use SOCKTRC as a service ?&lt;/STRONG&gt;&lt;/U&gt;&lt;BR&gt;&lt;BR&gt;First, ensure that the SOCKTRC arguments that you plan to use are valid. If your plan is to use SOCKTRC to silently proxy HTTP traffic, then you may want to use arguments like : "SOCKTRC /S:80 /D:80 /H:someweb /T". Once you have tested and confirmed that the SOCKTRC command line is valid, all tou have to do is to type the desired command line and add the "/I" flag to install the SOCKTRC service. You can then "NET START SOCKTRC"... When SOCKTRC is executed as a service, the output is sent using OutputDebugString (you can use a tool like DBMON to display it). &lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4207882" width="1" height="1"&gt;</description></item><item><title>Introduction to STRACE/HTTPREPLAY support tools</title><link>http://blogs.msdn.com/emmanubo/archive/2007/06/04/introduction-to-strace-httpreplay-support-tools.aspx</link><pubDate>Mon, 04 Jun 2007 14:02:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3079351</guid><dc:creator>emmanubo</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/emmanubo/comments/3079351.aspx</comments><wfw:commentRss>http://blogs.msdn.com/emmanubo/commentrss.aspx?PostID=3079351</wfw:commentRss><description>&lt;P&gt;I'm Emmanuel Boersma and I'm Escalation Engineer on Internet Explorer for EMEA (I'm located in Paris). As a support engineer, I use and occasionally write troubleshooting tools. Today, I'm going to give some details on the following tools recently posted on Microsoft's download center: &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;STRACE - &lt;A href="http://www.microsoft.com/downloads/details.aspx?FamilyID=f5ec767f-27f2-4fb3-90a5-4bf0d5f4810a&amp;amp;displaylang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?FamilyID=f5ec767f-27f2-4fb3-90a5-4bf0d5f4810a&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyID=f5ec767f-27f2-4fb3-90a5-4bf0d5f4810a&amp;amp;displaylang=en&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;HTTPREPLAY - &lt;A href="http://www.microsoft.com/downloads/details.aspx?FamilyID=d25ba362-c17b-4d80-a677-1faff862e629&amp;amp;DisplayLang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?FamilyID=d25ba362-c17b-4d80-a677-1faff862e629&amp;amp;DisplayLang=en"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyID=d25ba362-c17b-4d80-a677-1faff862e629&amp;amp;DisplayLang=en&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Good and bad things about WININET logs&lt;/U&gt;&lt;/STRONG&gt; &lt;/P&gt;
&lt;P&gt;If you are dealing with HTTP issues in IE or if you write applications on top of WININET, you probably know WININET.DLL and WININET logging in order to generate HTTP traces. WININET logging is described in the following article : &lt;A href="http://support.microsoft.com/kb/884931" mce_href="http://support.microsoft.com/kb/884931"&gt;http://support.microsoft.com/kb/884931&lt;/A&gt;. The log produced contains details regarding calls to WININET API, data sent &amp;amp; received including clear text &amp;amp; encrypted data if you are using SSL. &lt;/P&gt;
&lt;P&gt;Here's an abstract of a WININET.LOG for a connection to &lt;A href="http://www.microsoft.com/" mce_href="http://www.microsoft.com"&gt;www.microsoft.com&lt;/A&gt; :&lt;/P&gt;
&lt;P&gt;18:00:38.369 00000b60:&amp;lt;app&amp;gt; 001 InternetConnectA(0xcc0004, "&lt;A href="http://www.microsoft.com/" mce_href="http://www.microsoft.com"&gt;www.microsoft.com&lt;/A&gt;", 80, "", "", INTERNET_SERVICE_HTTP (3), 0x00000000, 0x203668)&lt;BR&gt;18:00:38.370 00000b60:&amp;lt;app&amp;gt; 001 HttpOpenRequestA(0xcc0008, "GET", "/", "", "", 0x137518, 0x00400000, 0x00203668)&lt;BR&gt;18:00:38.372 00000b60:&amp;lt;app&amp;gt; 001 HttpSendRequestA(0xcc000c, "Accept-Language: en-us\r\nAccept-Encoding: gzip, deflate", -1, 0x0, 0)&lt;BR&gt;18:00:38.679 000007a4:&amp;lt;---&amp;gt; 000 sending data:&lt;BR&gt;18:00:38.679 000007a4:&amp;lt;---&amp;gt; 000 658 (0x292) bytes @ 0x217518&lt;BR&gt;18:00:38.679 000007a4:&amp;lt;---&amp;gt; 000 00217518&amp;nbsp; 47 45 54 20 68 74 74 70-3a 2f 2f 77 77 77 2e 6d&amp;nbsp;&amp;nbsp; GET &lt;A href="http://www.m/" mce_href="http://www.m"&gt;http://www.m&lt;/A&gt;&lt;BR&gt;18:00:38.679 000007a4:&amp;lt;---&amp;gt; 000 00217528&amp;nbsp; 69 63 72 6f 73 6f 66 74-2e 63 6f 6d 2f 20 48 54&amp;nbsp;&amp;nbsp; icrosoft.com/ HT&lt;BR&gt;18:00:38.679 000007a4:&amp;lt;---&amp;gt; 000 00217538&amp;nbsp; 54 50 2f 31 2e 31 0d 0a-41 63 63 65 70 74 3a 20&amp;nbsp;&amp;nbsp; TP/1.1..Accept: &lt;BR&gt;18:00:38.679 000007a4:&amp;lt;---&amp;gt; 000 00217548&amp;nbsp; 69 6d 61 67 65 2f 67 69-66 2c 20 69 6d 61 67 65&amp;nbsp;&amp;nbsp; image/gif, image&lt;BR&gt;18:00:38.679 000007a4:&amp;lt;---&amp;gt; 000 00217558&amp;nbsp; 2f 78 2d 78 62 69 74 6d-61 70 2c 20 69 6d 61 67&amp;nbsp;&amp;nbsp; /x-xbitmap, imag&lt;BR&gt;18:00:38.679 000007a4:&amp;lt;---&amp;gt; 000 00217568&amp;nbsp; 65 2f 6a 70 65 67 2c 20-69 6d 61 67 65 2f 70 6a&amp;nbsp;&amp;nbsp; e/jpeg, image/pj&lt;BR&gt;18:00:38.679 000007a4:&amp;lt;---&amp;gt; 000 00217578&amp;nbsp; 70 65 67 2c 20 61 70 70-6c 69 63 61 74 69 6f 6e&amp;nbsp;&amp;nbsp; peg, application&lt;BR&gt;18:00:38.679 000007a4:&amp;lt;---&amp;gt; 000 00217588&amp;nbsp; 2f 78 2d 73 68 6f 63 6b-77 61 76 65 2d 66 6c 61&amp;nbsp;&amp;nbsp; /x-shockwave-fla&lt;BR&gt;18:00:38.679 000007a4:&amp;lt;---&amp;gt; 000 00217598&amp;nbsp; 73 68 2c 20 61 70 70 6c-69 63 61 74 69 6f 6e 2f&amp;nbsp;&amp;nbsp; sh, application/&lt;BR&gt;18:00:38.679 000007a4:&amp;lt;---&amp;gt; 000 002175a8&amp;nbsp; 76 6e 64 2e 6d 73 2d 65-78 63 65 6c 2c 20 61 70&amp;nbsp;&amp;nbsp; vnd.ms-excel, ap&lt;BR&gt;18:00:38.875 000007a4:&amp;lt;---&amp;gt; 000 received data:&lt;BR&gt;18:00:38.875 000007a4:&amp;lt;---&amp;gt; 000 1024 (0x400) bytes @ 0x217518&lt;BR&gt;18:00:38.875 000007a4:&amp;lt;---&amp;gt; 000 00217518&amp;nbsp; 48 54 54 50 2f 31 2e 31-20 32 30 30 20 4f 4b 0d&amp;nbsp;&amp;nbsp; HTTP/1.1 200 OK.&lt;BR&gt;18:00:38.875 000007a4:&amp;lt;---&amp;gt; 000 00217528&amp;nbsp; 0a 50 72 6f 78 79 2d 43-6f 6e 6e 65 63 74 69 6f&amp;nbsp;&amp;nbsp; .Proxy-Connectio&lt;BR&gt;18:00:38.875 000007a4:&amp;lt;---&amp;gt; 000 00217538&amp;nbsp; 6e 3a 20 4b 65 65 70 2d-41 6c 69 76 65 0d 0a 43&amp;nbsp;&amp;nbsp; n: Keep-Alive..C&lt;BR&gt;18:00:38.875 000007a4:&amp;lt;---&amp;gt; 000 00217548&amp;nbsp; 6f 6e 6e 65 63 74 69 6f-6e 3a 20 4b 65 65 70 2d&amp;nbsp;&amp;nbsp; onnection: Keep-&lt;BR&gt;18:00:38.875 000007a4:&amp;lt;---&amp;gt; 000 00217558&amp;nbsp; 41 6c 69 76 65 0d 0a 43-6f 6e 74 65 6e 74 2d 4c&amp;nbsp;&amp;nbsp; Alive..Content-L&lt;BR&gt;18:00:38.875 000007a4:&amp;lt;---&amp;gt; 000 00217568&amp;nbsp; 65 6e 67 74 68 3a 20 33-32 31 30 31 0d 0a 56 69&amp;nbsp;&amp;nbsp; ength: 32101..Vi&lt;/P&gt;
&lt;P&gt;In addition to the data sent &amp;amp; received on connections, WININET log provides output regarding calls to WININET API which can be useful if you want to troubleshoot WININET application. The painful things regarding WININET are the following :&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;you need to get the appropriate debug build of WININET.DLL for your OS/configuration. You cannot use a debug build of WININET.DLL for XP SP2/IE7 and use it on Windows 2003 or Vista. Since WININET is also included in IE security fixes, it can be a real pain to find the appropriate debug version of WININET matching your configuration&lt;/LI&gt;
&lt;LI&gt;the log produced may not contain any socket information indicating on which connection the data is sent/received&lt;/LI&gt;
&lt;LI&gt;you cannot generate a WININET log for a process that has already been started without WININET logging enabled.&lt;BR&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;STRACE as an alternative to&amp;nbsp; WININET logging&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;The main goal of STRACE is to produce similar logging to WININET log without the above constraints. In addition STRACE is not limited to IE/HTTP. It can be used to trace any socket based application like, for example, Outlook Express. If the application uses SSL, STRACE will dump clear text data before encryption &amp;amp; after decryption. All you need to do is install the tool and double click on it : this will run a new Internet Explorer instance and generate a trace on the desktop for this IE instance. Here's the STRACE equivalent for above WININET log:&lt;/P&gt;
&lt;P&gt;03/28/2007 13:33:48:758 - socket 0x000002cc created&lt;BR&gt;03/28/2007 13:33:48:758 - connect socket 0x000002cc (65.53.196.57:80)&lt;BR&gt;=====================================================&lt;BR&gt;03/28/2007 13:33:49:305 - 719 byte(s) sent on socket 0x000002cc&lt;BR&gt;=====================================================&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f&amp;nbsp;&amp;nbsp; 0123456789abcdef&lt;BR&gt;0000: 47 45 54 20 68 74 74 70 3a 2f 2f 77 77 77 2e 6d&amp;nbsp;&amp;nbsp; GET &lt;A href="http://www.m/" mce_href="http://www.m"&gt;http://www.m&lt;/A&gt;&lt;BR&gt;0010: 69 63 72 6f 73 6f 66 74 2e 63 6f 6d 2f 20 48 54&amp;nbsp;&amp;nbsp; icrosoft.com/ HT&lt;BR&gt;0020: 54 50 2f 31 2e 31 0d 0a 41 63 63 65 70 74 3a 20&amp;nbsp;&amp;nbsp; TP/1.1..Accept: &lt;BR&gt;...&lt;BR&gt;=====================================================&lt;BR&gt;03/28/2007 13:33:49:540 - 583 byte(s) received on socket 0x000002cc&lt;BR&gt;=====================================================&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f&amp;nbsp;&amp;nbsp; 0123456789abcdef&lt;BR&gt;0000: 48 54 54 50 2f 31 2e 31 20 33 30 32 20 46 6f 75&amp;nbsp;&amp;nbsp; HTTP/1.1 302 Fou&lt;BR&gt;0010: 6e 64 0d 0a 50 72 6f 78 79 2d 43 6f 6e 6e 65 63&amp;nbsp;&amp;nbsp; nd..Proxy-Connec&lt;BR&gt;...&lt;BR&gt;=====================================================&lt;BR&gt;03/28/2007 13:33:49:540 - 737 byte(s) sent on socket 0x000002cc&lt;BR&gt;=====================================================&lt;/P&gt;
&lt;P&gt;If you want to generate a LOG for a process other than IE7, Outlook Express for example, you'll just need to change the running process in STRACE.CMD by MSIMN.EXE&amp;nbsp; :&lt;/P&gt;
&lt;P&gt;withdll /d:STRACE.dll_IE6 "%programfiles%\outlook express\msimn.exe"&lt;/P&gt;
&lt;P&gt;The above command allows to trace SMTP/POP3/IMAP activity for Outlook Express on XP SP2.&lt;/P&gt;
&lt;P&gt;Since STRACE is based on detours library (&lt;A href="http://research.microsoft.com/sn/detours/" mce_href="http://research.microsoft.com/sn/detours/"&gt;http://research.microsoft.com/sn/detours/&lt;/A&gt;), you can also "inject" the STRACE tracing DLL in an existing process using the "injlib" tool (see STRACE page for details).&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;HTTPREPLAY or how to parse and replay HTTP from a log file&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Now, there is still one problem with either WININET or STRACE logging : you need to use your favorite editor and walk through the log …. Since a WININET or STRACE log can quickly take more than 100 MB, you may spend some time to find exactly what you are looking for.&amp;nbsp; This is where the HTTPREPLAY tool can help you. HTTPREPLAY provides the following services :&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;HTTPREPLAY parses STRACE or WININET log and generate a report&lt;/LI&gt;
&lt;LI&gt;HTTPREPLAY can then be used to replay a live scenario based on the log&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Once you have install the tool, you can browse to any STRACE and WININET log and open it using right-click -&amp;gt; Open With -&amp;gt; navigate to “c:\program files\httpreplay\httpreplay.cmd”. After the log is parsed, you’ll get a report similar to the following :&lt;/P&gt;&lt;IFRAME src="http://blogs.msdn.com/emmanubo/attachment/3079351.ashx" width="90%" height=500 mce_src="http://blogs.msdn.com/emmanubo/attachment/3079351.ashx"&gt;&lt;/IFRAME&gt;
&lt;P&gt;The HTTPREPLAY report provides :&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;summary of HTTP requests / responses&lt;/LI&gt;
&lt;LI&gt;details for every request/reponse (click on GET request or HTTP status code to get details)&lt;/LI&gt;
&lt;LI&gt;statistic allowing to measure number of request/response time, bytes sent &amp;amp; received…etc&lt;/LI&gt;
&lt;LI&gt;logic to point common HTTP issues like : slow response from the server, failed request, bad content-length&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Replaying HTTP from a log&lt;/U&gt;&lt;/STRONG&gt;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Now that the LOG has been loaded &amp;amp; parsed, HTTPREPLAY can be used to replay any response for the URLs listed in the log. The replay can be done in “proxy mode” or “direct mode”. “Proxy mode” just consists to set the replay tool as your proxy (by default : localhost:81). Direct mode requires that you edit the hosts file and enter all hosts referenced in the trace. I personally recommend to use proxy mode since this ensures every HTTP request will hit the tool. When you request specific content (by clicking on a URL in the report), you’ll see the requests/responses in the HTTPREPLAY command window :&lt;/P&gt;
&lt;P&gt;17:53:14:623 #0 - GET &lt;A href="http://www.microsoft.com/" mce_href="http://www.microsoft.com/"&gt;http://www.microsoft.com/&lt;/A&gt; [FOUND]&lt;BR&gt;17:53:14:623 #0 - 127.0.0.1:2142 &amp;lt;- :81 (583 bytes / total : 583 bytes)&lt;BR&gt;17:53:14:639 #0 - 127.0.0.1:2142 -&amp;gt; :81 (731 bytes / total : 1444 bytes)&lt;BR&gt;17:53:14:639 #0 - GET &lt;A href="http://www.microsoft.com/en/us/default.aspx" mce_href="http://www.microsoft.com/en/us/default.aspx"&gt;http://www.microsoft.com/en/us/default.aspx&lt;/A&gt; [FOUND]&lt;BR&gt;17:53:14:639 #0 - 127.0.0.1:2142 &amp;lt;- :81 (1024 bytes / total : 1607 bytes)&lt;BR&gt;17:53:14:639 #0 - 127.0.0.1:2142 &amp;lt;- :81 (3356 bytes / total : 4963 bytes)&lt;BR&gt;17:53:14:639 #0 - 127.0.0.1:2142 &amp;lt;- :81 (1460 bytes / total : 6423 bytes)&lt;BR&gt;17:53:14:639 #0 - 127.0.0.1:2142 &amp;lt;- :81 (1536 bytes / total : 7959 bytes)&lt;BR&gt;17:53:14:654 #0 - 127.0.0.1:2142 &amp;lt;- :81 (1460 bytes / total : 9419 bytes)&lt;BR&gt;17:53:14:654 #0 - 127.0.0.1:2142 &amp;lt;- :81 (6072 bytes / total : 15491 bytes)&lt;BR&gt;17:53:14:654 #0 - 127.0.0.1:2142 &amp;lt;- :81 (1460 bytes / total : 16951 bytes)&lt;BR&gt;...&lt;/P&gt;
&lt;P&gt;If the HTTPREPLAY command window doesn’t show anything then you are either not using the tool as your proxy or forgot to add a host in you hosts file.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Changing replayed content&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Since&amp;nbsp;we know how to generate a trace and replay it, wouldn’t it be interesting to change the way the content is “replayed” ? For example, what should I do to add an alert() in a js files ? Well, the 1st step consists to extract the responses in individual files. Running the following command will do the job :&lt;/P&gt;
&lt;P&gt;C:\Program Files\HTTPREPLAY&amp;gt;httpreplay STRACE_IEXPLORE_PID_3932.LOG /xtract&lt;BR&gt;...&lt;BR&gt;18:10:44:393 50 files extracted (use /USEFILES switch to replay from files)&lt;/P&gt;
&lt;P&gt;C:\Program Files\HTTPREPLAY&amp;gt;dir *.replay&lt;/P&gt;
&lt;P&gt;Directory of C:\Program Files\HTTPREPLAY&lt;/P&gt;
&lt;P&gt;31/05/2007&amp;nbsp; 18:10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7 763 index.replay&lt;BR&gt;31/05/2007&amp;nbsp; 18:10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 583 request0001.replay&lt;BR&gt;31/05/2007&amp;nbsp; 18:10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 40 389 request0002.replay&lt;BR&gt;...&lt;BR&gt;31/05/2007&amp;nbsp; 18:10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 735 request0050.replay&lt;BR&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The index.replay lists all URLs &amp;amp; response files :&lt;/P&gt;
&lt;P&gt;C:\Program Files\HTTPREPLAY&amp;gt;type index.replay&lt;BR&gt;&lt;A href="http://www.microsoft.com/@request0001.replay" mce_href="http://www.microsoft.com/@request0001.replay"&gt;http://www.microsoft.com/@request0001.replay&lt;/A&gt;&lt;BR&gt;&lt;A href="http://www.microsoft.com/en/us/default.aspx@request0002.replay" mce_href="http://www.microsoft.com/en/us/default.aspx@request0002.replay"&gt;http://www.microsoft.com/en/us/default.aspx@request0002.replay&lt;/A&gt;&lt;BR&gt;&lt;A href="http://js.microsoft.com/shared/core/1/js/library.js@request0003.replay" mce_href="http://js.microsoft.com/shared/core/1/js/library.js@request0003.replay"&gt;http://js.microsoft.com/shared/core/1/js/library.js@request0003.replay&lt;/A&gt;&lt;BR&gt;…&lt;/P&gt;
&lt;P mce_keep="true"&gt;You can&amp;nbsp;“replay” from the response files using the following command: httpreplay /USEFILES. If you want to change the response’s content, you’ll just need to edit the required “*.replay” file.&amp;nbsp; Since HTTPREPLAY can use both STRACE log and index.replay, consider the following approach if you want to add an alert to a single JS file :&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;edit index.replay and only keep responses that you plan to change (example : &lt;A href="http://js.microsoft.com/shared/core/1/js/library.js@request0003.replay" mce_href="http://js.microsoft.com/shared/core/1/js/library.js@request0003.replay"&gt;http://js.microsoft.com/shared/core/1/js/library.js@request0003.replay&lt;/A&gt;)&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;edit the response file (request0003.replay), add alert(‘test’) in the 1st script block and save it (don’t forget to remove the content-length header as detailed in the tool’s documentation)&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;clear the IE cache and run the tool to replay from both log file and index : httpreplay strace_www-microsoft-com.log /USEFILES&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;The above approach can be useful for support engineers to reproduce problems, implement &amp;amp; test workarounds. It can also help web site developpers to write and test modifications offline.&lt;/P&gt;
&lt;P&gt;I hope you’ll find the above tools useful and will get back to you with more blogs/info in the near future….&lt;/P&gt;
&lt;P&gt;&amp;nbsp;- Emmanuel&lt;BR&gt;&lt;/P&gt;&lt;/IFRAME&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3079351" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/emmanubo/attachment/3079351.ashx" length="181903" type="text/html" /></item></channel></rss>