Andrew Powell

Into The Mind of A Solutions Architect

Andrew Powell

Capturing Localhost Traffic with Charles or Service Capture

January 8, 2009 · 4 Comments

Most of us use tools like Charles or Service Capture to help debug our web applications and flex applications.  They show you the AMF data going back and forth between your browser and the server.  It's all very helpful.  However, there's a little trick if you are trying to debug traffic to a local instance of a server.  Say you're running tomcat locally and are trying to debug the calls with one of these tools.  In your browser, you would put:

http://localhost:8080/mycontextroot/myapp.html

This works to test the app, but you don't see anything in your debugger tool. If you want this traffic to show up in your debugger, you need to use the following variation on the url:

http://localhost.:8080/mycontextroot/myapp.html

This will ensure that you do not bypass the proxy settings used to route your web traffic through the debugger.  

Tags: AJAX · BlazeDS · ColdFusion · Flex · Java · JSP · Service Capture · Silverlight · Spry · Universal Mind · XML

4 responses so far ↓

  • 1 Sönke Rohde // Jan 15, 2009 at 2:47 PM

    nice one! I always used my ip adress like 192. ... but did not know it works with the "." after localhost
  • 2 Lach // Jul 13, 2010 at 11:13 PM

    Excellent. Thanks for the Tip, Andy. Can't count the number of times I've needed this.
  • 3 Jarrek // Mar 10, 2011 at 8:30 AM

    Work perfectly with charles proxy + flex client + servlet server ...
  • 4 Héctor // Oct 20, 2011 at 4:20 AM

    Thanks for the tip! I really wanted to achieve tracing connections on local enviroment for a long time :)

Leave a Comment