Fundamentals 8 min read

Master HTTP/HTTPS Debugging on macOS with Charles: A Step‑by‑Step Guide

This tutorial walks you through using Charles on macOS to capture and manipulate HTTP and HTTPS traffic for both PC and mobile devices, covering proxy configuration, SSL handling, breakpoints, throttling, DNS spoofing, request rewriting, remote/local redirection, and basic stress testing.

Lin is Dream
Lin is Dream
Lin is Dream
Master HTTP/HTTPS Debugging on macOS with Charles: A Step‑by‑Step Guide

HTTP and TCP/IP are the foundation of web traffic. This article introduces how to use Charles on macOS to capture HTTP and HTTPS requests for both PC and mobile devices.

1. PC‑side HTTP capture

Open the top menu, select Proxy → macOS Proxy to enable PC‑side capture.

2. PC‑side HTTPS capture

Install the Charles root certificate and trust it via SSL Proxying → Install Charles Root Certificate.

Enable SSL Proxying: Proxy → SSL Proxying Settings, check Enable SSL Proxying , then configure the domain and port as shown.

Charles SSL proxy settings screenshot
Charles SSL proxy settings screenshot

Click confirm to start capturing both HTTP and HTTPS requests.

3. Mobile capture

Enable Proxy → Poxy Setting, check all options, set the proxy port, then configure the mobile device’s Wi‑Fi HTTP proxy to the PC’s IP address and port (e.g., 8888). The PC’s local IP can be found under Help → Local IP Address.

Mobile proxy configuration screenshot
Mobile proxy configuration screenshot

4. Mobile HTTPS capture

Install and trust the root certificate on the phone, then open

Help → SSL Proxying → Install Charles Root Certificate on a Mobile Device Or Remote Browser

. Visit chls.pro/ssl on the phone to download the certificate.

5. Request breakpoints

Enable breakpoints to debug requests. When a request hits a breakpoint, a dialog appears allowing you to modify the request or response before execution.

Identify the request URL to breakpoint.

Open Proxy → Breakpoints Setting (shortcut ⌘+Shift+K), add the URL, choose to modify Request or Response.

Resend the request; the breakpoint dialog lets you edit and then execute.

Breakpoint settings screenshot
Breakpoint settings screenshot

6. Throttle network speed

Simulate weak network conditions via Proxy → Throttle Settings, where you can set bandwidth limits.

Throttle settings screenshot
Throttle settings screenshot

7. Simple stress testing

Select a request, right‑click and choose Repeat Advanced to repeat the request with configurable iteration count and concurrency.

Stress test configuration screenshot
Stress test configuration screenshot

8. DNS spoofing

Redirect a domain to a custom IP via Tool → DNS Spoofing. Example: map www.baidu.com to scny.weiwogroup.cn. Note the limitation that the target port must match.

DNS spoofing settings screenshot
DNS spoofing settings screenshot

9. Request rewriting

Similar to breakpoints but persistent. Enable Tool → Rewrite Settings and define rules to modify Path, URL, Body, Query, or Header using regular expressions.

Rewrite rule editor screenshot
Rewrite rule editor screenshot

10. Remote request mapping

Use Tool → Map Remote to forward remote endpoints to another remote address, useful for directing production APIs to a local development server.

Remote mapping settings screenshot
Remote mapping settings screenshot

11. Local request mapping

Similar to remote mapping but forwards the request to a local file, allowing you to capture and edit responses locally.

Additional utilities

Other features include port forwarding via the Proxy and Tool menus, which can be explored further as needed.

proxymobile debuggingnetwork analysismacOSCharlesHTTP debugging
Lin is Dream
Written by

Lin is Dream

Sharing Java developer knowledge, practical articles, and continuous insights into computer engineering.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.