SlideShare a Scribd company logo
DEBUGGING WITH CHARLES
                           Keegan Street (@kstre)
                      Front End Dev at Deloitte Digital

Tuesday, 31 July 12
What is Charles?
      An HTTP proxy sitting between your browsers/apps and the Internet.




            Browsers/apps                              The Internet
                                   Charles

Tuesday, 31 July 12
Features of Charles
            •   Record Requests                    •   Automatic Rewrite Tool
            •   Throttling                         •   Blacklist
            •   Breakpoints                        •   DNS Spoofing
            •   SSL Proxying                       •   Mirroring
            •   Reverse Proxy                      •   Repeat/Modify Requests Tool
            •   Port Forwarding                    •   Basic Load Testing
            •   Cache Busting Tool                 •   Markup Validation
            •   Block Cookies Tool (for testing)   •   Web Interface (could be used as
                                                       an API)
            •   Local Mappings
                                                   •   Testing Across Devices
            •   Remote Mappings

Tuesday, 31 July 12
Tuesday, 31 July 12
CACHE BUSTING TOOL
Tuesday, 31 July 12
A Normal HTTP Request

                      GET /css/global.css HTTP/1.1
                      Host: static.southaustralia.com
                      User-Agent: Mozilla/5.0 ...
                      Accept: text/css,*/*;q=0.1
                      If-Modified-Since: Fri, 08 Jun 2012 08:24:44 GMT
                      If-None-Match: "06e55285045cd1:0"
                      Referer: http://www.southaustralia.com/
                      Accept-Language: en-us
                      Accept-Encoding: gzip, deflate
                      Connection: keep-alive




Tuesday, 31 July 12
An HTTP Request with Charles
               “No Caching”
                          GET /css/global.css HTTP/1.1
                          Host: static.southaustralia.com
                          User-Agent: Mozilla/5.0 ...
                          Accept: text/css,*/*;q=0.1
                      -   If-Modified-Since: Fri, 08 Jun 2012 08:24:44 GMT
                      -   If-None-Match: "06e55285045cd1:0"
                          Referer: http://www.southaustralia.com/
                          Accept-Language: en-us
                          Accept-Encoding: gzip, deflate
                          Connection: keep-alive
                      +   Pragma: no-cache
                      +   Cache-Control: no-cache




Tuesday, 31 July 12
Cache Busting Tool
                      Works by adding and removing headers
                       from HTTP requests and responses.

                                 Removed                  Added

                           If-Modified-Since: ... Pragma: no-cache
                 Request   If-None-Match: ...     Cache-control: no-cache


                           Expires: ...
                                                  Expires: 0
               Response    Last-Modified: ...
                                                  Cache-Control: no-cache
                           ETag: ...




Tuesday, 31 July 12
REMOTE MAPPINGS
                      & LOCAL MAPPINGS
Tuesday, 31 July 12
Remote Mappings

    • Configure     a mapping from one URL to another
        to transparently serve assets from a different
        location.
    • Example    usage: Map jquery-1.5.1.js to
        code.jquery.com/jquery-1.7.2.js on your
        production server and see if it breaks.

Tuesday, 31 July 12
Local Mappings


    • Same   as remote mappings, but they are used to
        map remote URLs to local assets.
    • Example      usage: Make your production server
        load all JavaScript and CSS files from your local
        development folder.


Tuesday, 31 July 12
Tuesday, 31 July 12
Tuesday, 31 July 12
Tuesday, 31 July 12
Tuesday, 31 July 12
Tuesday, 31 July 12
Tuesday, 31 July 12
Tuesday, 31 July 12
Tuesday, 31 July 12
Tuesday, 31 July 12
Tuesday, 31 July 12
BREAKPOINTS

Tuesday, 31 July 12
Breakpoints

    • Intercept requests and responses and modify
        them before they are sent.
    • Is  the front-end sending incorrect parameters?
        Try modifying the request.
    • Is  the server returning something unexpected?
        Try modifying the response.


Tuesday, 31 July 12
Tuesday, 31 July 12
Tuesday, 31 July 12
Tuesday, 31 July 12
Tuesday, 31 July 12
Tuesday, 31 July 12
Tuesday, 31 July 12
Tuesday, 31 July 12
Tuesday, 31 July 12
Tuesday, 31 July 12
Tuesday, 31 July 12
Tuesday, 31 July 12
Tuesday, 31 July 12
Tuesday, 31 July 12
www.charlesproxy.com

Tuesday, 31 July 12

More Related Content

PDF
Test strategies for data processing pipelines
PDF
Low-Code App Development
PDF
Secure Code Review 101
PDF
Big Data Analytics with R
PPTX
Insprint automation, build the culture
PPTX
Career Prospects and Scope of Data Science in India
PDF
Generative-AI-in-enterprise-20230615.pdf
Test strategies for data processing pipelines
Low-Code App Development
Secure Code Review 101
Big Data Analytics with R
Insprint automation, build the culture
Career Prospects and Scope of Data Science in India
Generative-AI-in-enterprise-20230615.pdf

What's hot (20)

PPTX
Cross platform app development with flutter
PDF
Attacking and defending GraphQL applications: a hands-on approach
PPTX
Full stack development
PPTX
Random Forest In R | Random Forest Algorithm | Random Forest Tutorial |Machin...
PDF
Big Data Analytics Architecture PowerPoint Presentation Slides
PPTX
Intern presentation based on Flutter Lawyer App.
PPTX
Powerpoint Guidelines
PDF
Introduction to Software Test Automation
PDF
Ruin your life using robot framework
PDF
Successfully Implementing BDD in an Agile World
PPTX
Secure coding guidelines
PDF
Perils of Page-Object Pattern
PDF
Serenity-BDD training
DOC
Deepa_Resume (Manual Testing _2 years Exp_Updated)
DOCX
3 years of experience in Software Testing
PDF
Automated vs manual testing
PPTX
Cross Site Scripting ( XSS)
PPTX
Exactly-Once Made Easy: Transactional Messaging in Apache Pulsar - Pulsar Sum...
PDF
Cypress e2e automation testing - day1 intor by: Hassan Hameed
PPTX
Dart programming language
Cross platform app development with flutter
Attacking and defending GraphQL applications: a hands-on approach
Full stack development
Random Forest In R | Random Forest Algorithm | Random Forest Tutorial |Machin...
Big Data Analytics Architecture PowerPoint Presentation Slides
Intern presentation based on Flutter Lawyer App.
Powerpoint Guidelines
Introduction to Software Test Automation
Ruin your life using robot framework
Successfully Implementing BDD in an Agile World
Secure coding guidelines
Perils of Page-Object Pattern
Serenity-BDD training
Deepa_Resume (Manual Testing _2 years Exp_Updated)
3 years of experience in Software Testing
Automated vs manual testing
Cross Site Scripting ( XSS)
Exactly-Once Made Easy: Transactional Messaging in Apache Pulsar - Pulsar Sum...
Cypress e2e automation testing - day1 intor by: Hassan Hameed
Dart programming language
Ad

Similar to Charles (20)

PDF
Optimising Web Application Frontend
PDF
Let's speed it up a bit (AmsterdamPHP)
PDF
Tuning web performance
PDF
Tuning Web Performance
PDF
Clug 2012 March web server optimisation
PDF
Website Performance Basics
PDF
Caching in HTTP
PDF
Making the web faster
PDF
Website Performance: server- and clientside techniques
PDF
Creating an Effective Mobile API
KEY
Modern Web technologies (and why you should care): Megacomm, Jerusalem, Febru...
KEY
Modern Web Technologies — Jerusalem Web Professionals, January 2011
PDF
Optimizing Your Frontend Performance
PDF
12 core technologies you should learn, love, and hate to be a 'real' technocrat
PDF
HTTP cache @ PUG Rome 03-29-2011
KEY
Page Performance
PDF
Web performance optimization - MercadoLibre
KEY
Building Faster Websites
PDF
KEY
Fearless HTTP requests abuse
Optimising Web Application Frontend
Let's speed it up a bit (AmsterdamPHP)
Tuning web performance
Tuning Web Performance
Clug 2012 March web server optimisation
Website Performance Basics
Caching in HTTP
Making the web faster
Website Performance: server- and clientside techniques
Creating an Effective Mobile API
Modern Web technologies (and why you should care): Megacomm, Jerusalem, Febru...
Modern Web Technologies — Jerusalem Web Professionals, January 2011
Optimizing Your Frontend Performance
12 core technologies you should learn, love, and hate to be a 'real' technocrat
HTTP cache @ PUG Rome 03-29-2011
Page Performance
Web performance optimization - MercadoLibre
Building Faster Websites
Fearless HTTP requests abuse
Ad

Recently uploaded (20)

PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Approach and Philosophy of On baking technology
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Empathic Computing: Creating Shared Understanding
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
Big Data Technologies - Introduction.pptx
PDF
Modernizing your data center with Dell and AMD
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Encapsulation theory and applications.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPT
Teaching material agriculture food technology
PDF
KodekX | Application Modernization Development
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Approach and Philosophy of On baking technology
Encapsulation_ Review paper, used for researhc scholars
Per capita expenditure prediction using model stacking based on satellite ima...
Chapter 3 Spatial Domain Image Processing.pdf
Empathic Computing: Creating Shared Understanding
20250228 LYD VKU AI Blended-Learning.pptx
Mobile App Security Testing_ A Comprehensive Guide.pdf
Unlocking AI with Model Context Protocol (MCP)
Big Data Technologies - Introduction.pptx
Modernizing your data center with Dell and AMD
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Encapsulation theory and applications.pdf
Review of recent advances in non-invasive hemoglobin estimation
MYSQL Presentation for SQL database connectivity
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Teaching material agriculture food technology
KodekX | Application Modernization Development

Charles

  • 1. DEBUGGING WITH CHARLES Keegan Street (@kstre) Front End Dev at Deloitte Digital Tuesday, 31 July 12
  • 2. What is Charles? An HTTP proxy sitting between your browsers/apps and the Internet. Browsers/apps The Internet Charles Tuesday, 31 July 12
  • 3. Features of Charles • Record Requests • Automatic Rewrite Tool • Throttling • Blacklist • Breakpoints • DNS Spoofing • SSL Proxying • Mirroring • Reverse Proxy • Repeat/Modify Requests Tool • Port Forwarding • Basic Load Testing • Cache Busting Tool • Markup Validation • Block Cookies Tool (for testing) • Web Interface (could be used as an API) • Local Mappings • Testing Across Devices • Remote Mappings Tuesday, 31 July 12
  • 6. A Normal HTTP Request GET /css/global.css HTTP/1.1 Host: static.southaustralia.com User-Agent: Mozilla/5.0 ... Accept: text/css,*/*;q=0.1 If-Modified-Since: Fri, 08 Jun 2012 08:24:44 GMT If-None-Match: "06e55285045cd1:0" Referer: http://www.southaustralia.com/ Accept-Language: en-us Accept-Encoding: gzip, deflate Connection: keep-alive Tuesday, 31 July 12
  • 7. An HTTP Request with Charles “No Caching” GET /css/global.css HTTP/1.1 Host: static.southaustralia.com User-Agent: Mozilla/5.0 ... Accept: text/css,*/*;q=0.1 - If-Modified-Since: Fri, 08 Jun 2012 08:24:44 GMT - If-None-Match: "06e55285045cd1:0" Referer: http://www.southaustralia.com/ Accept-Language: en-us Accept-Encoding: gzip, deflate Connection: keep-alive + Pragma: no-cache + Cache-Control: no-cache Tuesday, 31 July 12
  • 8. Cache Busting Tool Works by adding and removing headers from HTTP requests and responses. Removed Added If-Modified-Since: ... Pragma: no-cache Request If-None-Match: ... Cache-control: no-cache Expires: ... Expires: 0 Response Last-Modified: ... Cache-Control: no-cache ETag: ... Tuesday, 31 July 12
  • 9. REMOTE MAPPINGS & LOCAL MAPPINGS Tuesday, 31 July 12
  • 10. Remote Mappings • Configure a mapping from one URL to another to transparently serve assets from a different location. • Example usage: Map jquery-1.5.1.js to code.jquery.com/jquery-1.7.2.js on your production server and see if it breaks. Tuesday, 31 July 12
  • 11. Local Mappings • Same as remote mappings, but they are used to map remote URLs to local assets. • Example usage: Make your production server load all JavaScript and CSS files from your local development folder. Tuesday, 31 July 12
  • 23. Breakpoints • Intercept requests and responses and modify them before they are sent. • Is the front-end sending incorrect parameters? Try modifying the request. • Is the server returning something unexpected? Try modifying the response. Tuesday, 31 July 12