Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Debugging API with Charles Proxy

Debugging API with Charles Proxy

Javal Nanda shares his experience about using Charles Proxy and how it can be useful to developers.


Swift India

May 27, 2017


  1. Introduction to Charles Proxy By: Javal Nanda Swift Pune Chapter

    - 1 27th May 2017
  2. What is Charles?

  3. Key features • SSL Proxying- view SSL requests and response

    in plain text. • Bandwidth Throttling- simulate slower Internet connections. • AJAX Debugging- view XML and JSON requests and response. • Repeat requests to test backend changes. • Edit Requests to different inputs. • Breakpoints to intercept and edit requests or responses. • Local/remote mapping
  4. Features + Demo

  5. View SSL Request • Install Charles root certificate in keychain

  6. View SSL Request • Make sure to mark it trusted

    in keychain
  7. View SSL Request • Install Charles root certificate in simulator

  8. View SSL Request • Enable SSL proxying for domain

  9. View SSL Request • Voila! Now you can see SSL

  10. Debugging • Set breakpoint of url you want to debug

    request/ response
  11. Debugging • By default breakpoint is enabled for both request

    and response
  12. Debugging • Your next request for same url will stop

    at breakpoint for request/response as per settings and you can edit the content to debug.
  13. Throtlling • You can test your app in slower network

    with throttle settings.
  14. Edit & repeat request • You can repeat existing api

    request in the logs with different inputs to test back end changes. You don’t need app if you have saved logs.
  15. Local/Remote Mapping • Map your request to fetch response from

    local mapping or remote mapping to other url.
  16. Repeat/Repeat Advance • You can use repeat advance to fire

    multiple request with concurrency. Can be useful for load/performance testing of a server.
  17. Connecting Device to proxy • First Get Local IP Adress

    from Charles Help menu.
  18. Connecting Device to proxy • First Get Local IP Adress

    from Charles Help menu.
  19. Configure proxy on device • Enter local ip address found

    in previous step in to host name and enter 8888 as port.
  20. Install Charles certificate • Go to chls.pro/ssl in browser and

    install SSL certificate. • Go To Settings > General > About > Certificate Trust Testings and enable charles certificate as Trusted
  21. Explore other features • Dive deeper into other features from

    the charles menu. • Educate your QA, Mobile and API team to use it so that there is transparency among all the team member and no one is dependent on each other. • QA team members can easily figure out if the issue is on API side or UI side which saves lot of back and forth on the issue assigning cycle.
  22. try! Swift Conference Book your tickets: https://www.tryswift.co/events/2017/bangalore/

  23. Thank you • github.com/javalnanda • twitter.com/javalnanda • linkedin.com/in/javal-nanda-15b11a18/ • hello@faodailtechnology.com