Introduction to how Charles Uses

Source: Internet
Author: User

Charles is a Web proxy used to record and display all the data you send and receive.

Key Features:

SSL proxying--easy to clear text display SSL requests and responses
Bandwidth throttling is used to simulate including potentially slow network connections
AJAX debugging--presentation of XML and JSON requests and responses in text or tree mode
amf--viewing the contents of Flash romoting/displaying remote messages as a tree
Repeat the request to test the backend changes
Edit the request to test the different inputs
The breakpoints is used to intercept and edit requests and responses.
Use the Html,css,rss validator to verify the recorded and atomic responses.

Introduction to use:
1. Download the installation package and install it.
2. Register. Select Register Charles within the Help window. (If you do not register, it will automatically quit once every 30 minutes, so register!) )
Registration code: Registered Name:anthony Ortolani
License KEY:A4036B2761C9583FDA

3. Set Charles as a system agent after you start Charles, the first time it asks you to set permissions on the System agent. You can enter the login password to grant Charles this permission. If you ignore the request, you can set Charles as a system agent by selecting "Proxy", "Mac OS X Proxy" in the menu.

4. Introduction to the main interface:

Charles provides two viewing views, "Structure" and "Sequence", respectively.
The 1.Structure View classifies network requests according to the domain name accessed.

The 2.Sequence view sorts the network requests by the time they are accessed.

Tool bar:

The toolbar left-to-right function is: 1. Create a new session 2. Open a session (already existing) 3. Close the current session 4. Store current session 5. Clears all requests currently captured 6. Search 7. Start/Stop capture 8. Start/Stop network emulation function 9. Start/Stop breakpoint function 10. Refresh Request selected 11. Edit 12. Verify the response (the result of the request) 13. Tools 14. Settings

Filtering Network Requests

Sometimes we need to filter the network requests and only monitor requests sent to the specified directory server. For this demand, we have 2 ways:
1. Fill in the filter bar in the middle of the main interface with keywords that need to be filtered out.
2. In Charles's menu bar, select "Proxy", "Recording Settings", then select the Include column, select Add an item, then fill in the protocol, host address, port number to be monitored. This allows you to intercept only the packets of the target Web site.
(PS: Generally, we use Method 1 to do some temporary packet filtering, Method 2 to do some regular packet filtering.) )

intercepting the network packets on the phone

Settings on the 1.Charles
To intercept the network request on the phone, we first need to turn on Charles's proxy function. In Charles's menu bar, select "Proxy", "Proxy Settings", fill in the agent port 8888, and check "Enable transparent HTTP proxying" to complete the setup on Charles.

2. Settings on the phone
1. We need to obtain the IP address of the computer where Charles is running, open terminal, enter Ifconfig en0 to get the IP of the computer.
2. In the phone's "settings", "Wi-Fi", you can see the current connection of the WiFi name, by long press the network name, pop up a dialog box, select "Modify Network Configuration", tick "show advanced options" can see at the bottom of its "HTTP proxy", we switch it to a manual , then fill in the IP of the computer where Charles is running, and the port number 8888. (PS: Each person's phone is different, so the individual details will vary)
3. After setting up, we open the iphone on any need for network communication program, you can see Charles pop up the iphone request connection Confirmation menu, click "Allow" to complete the setup.

Intercepting SSL Information
Charles does not intercept SSL by default, and if you want to intercept all SSL network requests on a Web site, you can right-click on the request and select SSL Proxy, as shown in:

This allows all SSL requests on the host to be intercepted. Cancel if you don't need it. Analog Slow network

If we need to simulate a slow network or a high-latency network to test whether the application behaves properly under the mobile network. We can set it up through Charles.
On the Charles menu, select "Proxy", "throttle Setting", in the dialog box that pops up, we can tick "Enable throttling" and set the type of throttle preset. If you only want to simulate a slow network for a specified site, you can tick the "only for selected hosts" item in the diagram and add the specified hosts to the lower half of the dialog box. As shown in the following:

Modify Network Request content

Charles provides the ability to modify and re-send network requests. We just need to right click on the existing network request and select "Edit" to create an editable network request. :

We can modify any information about the request, including the URL address, port, parameters, etc., and then click "Execute" to send the modified network request. (Ps:charles supports us to modify and send requests multiple times)

Introduction to how Charles Uses

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.