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

Leveraging Charles Proxy as a Developer

KHorn
July 19, 2019

Leveraging Charles Proxy as a Developer

Presentation about some tools available in Charles Proxy to help developers.

KHorn

July 19, 2019
Tweet

Other Decks in Technology

Transcript

  1. What is Charles Proxy? • “Charles is an HTTP proxy

    / HTTP monitor / Reverse Proxy that enables a developer to view all of the HTTP and SSL / HTTPS traffic between their machine and the Internet. This includes requests, responses and the HTTP headers (which contain the cookies and caching information).”
  2. What is Charles Proxy? • “Charles is an HTTP proxy

    / HTTP monitor / Reverse Proxy that enables a developer to view all of the HTTP and SSL / HTTPS traffic between their machine and the Internet. This includes requests, responses and the HTTP headers (which contain the cookies and caching information).” • “I’m pretty sure I handled that case properly”
  3. What is Charles Proxy? • “I KNOW I handled that

    case properly” • “Charles is an HTTP proxy / HTTP monitor / Reverse Proxy that enables a developer to view all of the HTTP and SSL / HTTPS traffic between their machine and the Internet. This includes requests, responses and the HTTP headers (which contain the cookies and caching information).”
  4. WiFi Settings -> expand Advanced Options -> “Manual” under proxy

    -> local IP in Proxy hostname -> “8888” in Proxy port -> save and close Setting up device Open browser and download certificate - chls.pro/ssl
  5. Initial Hiccups • Need to enable SSL Proxying for wanted

    endpoint • Red ‘X’ usually means that certificate wasn’t downloaded properly or forgot to declare networkSecurityConfig in the manifest
  6. Map local What is it? - Reroutes response to local

    file on machine Why use it? - Want to change data in response over and over
  7. Map local { "url": "https://anapioficeandfire.com/api/books/1", "name": "A Game of Thrones",

    "isbn": "978-0553103540", "authors": [ "George R. R. Martin" ], ... }
  8. Map local { "url": "https://anapioficeandfire.com/api/books/1", "name": "A Game of Thrones",

    "isbn": "978-0553103540", "authors": [ "George R. R. Martin" ], ... }
  9. Map local { "url": "https://anapioficeandfire.com/api/books/1", "name": "A Game of Thrones",

    "isbn": "978-0553103540", "authors": [ "George R. R. Martin", "Grace Hopper", "Ada Lovelace" ], ... }
  10. Map remote What is it? - Reroutes response to remote

    host Why use it? - Need to double check if endpoint change will affect app - Have an api with static/snapshot data to test specific scenario
  11. Rewrite What is it? - Rewrites response code, response/request body,

    modifying headers, modifying queries, and so much more! Why use it? - Response code affects app behaviors - Want to always modify a query
  12. Throttling What is it? - Changes (slows down) your network

    response time Why use it? - Office space networks != “normal” networks - Makes a difference with things like video buffering
  13. Blacklist What is it? - Blocks your network request Why

    use it? - Quick way to error check - “What will happen to this view if one part fails?”
  14. Breakpoints What is it? - Similar to code breakpoints, but

    within Charles Why use it? - POST/GET on same endpoint can get weird with map local - Only need a quick validation change
  15. Thank You! Credits: Charles: https://www.charlesproxy.com/ API: “An API of Ice

    And Fire” https://anapioficeandfire.com/ More learning: Mark Murphy backport: https://commonsware.com/blog/2016/07/11/backporting-android-n-n etwork-security-configuration.html “Learn you a Network Security Config for Great Good!” https://possiblemobile.com/2017/05/learn-network-security-config/