charles installation and tutorial

1.1 charles description
Charles is actually a proxy server, by itself into the system through the setting (or computer browsers) network access proxy server, and then intercepts the request and the request packet capture analysis results to achieve the purpose. The software is written in Java, it can be Windows, Mac, use on Linux. Charles' first time installation installed Java environment.

Charles' main functions:

(1) and taken Http Https network packets.

(2) supports a network request a retransmission, the rear end to facilitate debugging.

(3) to support the request to modify the network parameters.

(4) intercepts the request and the network to support dynamic modification.

(5) supports analog slow network.

1.1.1 charles download and install

1, download the installation package

(1) enter the official website to download the address: http: //www.charlesproxy.com/, click on the link to download the free 30-day trial version.

 

PS: Charles is billing software, free trial for 30 days. After the trial period, non-paying users can continue to use, but each time not more than 30 minutes, and there will be a delay of 10 seconds at startup. Therefore, the payment scheme for the majority of users is still quite friendly, even if you do not pay for long-term, also can use the full software functionality. Just when you need a long time to debug the packet will be forced to close because Charles encountered impact.

(2) Installation download crack version, can be installed

Installation package address: https: //pan.baidu.com/s/15nD088YT_Ahdt4JAiWsbHw Password: z2cf

Crack patch address: https: //pan.baidu.com/s/1I99-fRKhbbSZPpl1ew3kZA Password: asys

(1) Follow steps to download and install a first installation package;

(2) The crack patch pasted into charles under the lib file, and then replace the original file named charles off to

 

1.1.2 charles phone / computer connection

1.1.2.1 charles and the end of the phone connection

The mobile phones and computers in a LAN, do not have an ip segment, as long as the same the next router on it.

(1) Firstly, cmd -config command to view your computer's ip address

 

(2) and then set the phone side there's wifi agent to carry out the relevant configuration settings.

Here's proxy server address filled in as the computer's ip address, and then write port here 8888 (this is the default setting charles's), if they modify the port to write their own modifications on it.

 

Configuration is complete, you will see a side of the connection with the phone charles prompt pop, you can choose allo.

 

(3) mobile terminal capture https

Step 1 and 2 above, only for http request. Due to the special nature of https protocol, it requires a computer terminal and mobile terminal needs to be installed under the certificate, otherwise they will see the return of data are garbled.

a. computer terminal certificate download

 

b. Download mobile client certificate

Open the site http://www.charlesproxy.com/getssl Charles SSL certificate installed on the device.

Note that the same phone on different computers Charles correspond respectively to be downloaded certificates for authentication, because the certificate of the phone is a computer terminal and Charles paired one by one.

 

PS: ios phone, you need to trust the certificate

C. Related

Select Proxy | Proxy Settings, proxy settings tab, check Enable SSL Proxying, select add in the Location part, add the following chart, grab any of these sites, data port 443 pop.

 

1.1.2.2 charles connected to the computer terminal

Since charles will automatically configure browser proxy settings and tools, so that is already open the tool directly capture the state. Directly open the page on it.

 note:

(1) Charles support requests arrested http, https protocol does not support socket.

(Two programs on the network via a bidirectional communication to realize the exchange of data, called the connection end of a socket)

(2) off the firewall

1.1.2.3 Request Filter

Under normal circumstances, we need to filter network requests, monitoring only the request sent to the specified directory on the server. For this requirement, the following way:

Method One: Fill out the keywords to be filtered in the Filter bar in the middle of the main interface. For example, our server address is: www.baidu.com, then you only need to fill in www.baidu.com Filter bar.

 

Method two: Charles menu bar at the "Proxy" -> "Recording Settings", and then select the Include column, select an item to add, and then fill in the required monitoring protocols, host address, port number. This can only intercept packets of the target site. As shown below:

 

Normally, we use a method to do some temporary packet filtering, use the second method to do some regular packet filtering.

Method three: a request over the network want to filter right click and select "Focus", after one, as shown in FIG. Filter on a column check Focussed:

This embodiment can be temporary, filtered rapidly without requesting some type of network by a keyword.

 

1.2.charle main interface description
1.2.1 Interface Overview

After the start, the page shown below:

 

1.2.2 Display Mode

Charles has two display modes, stucture and sequence. Support switch back and forth.

(1) Structure FIG form following advantages: it can be clearly seen in the data structure of the request, and the requested information is divided domain, can be very clear to analyze and process the data.

 

(2) Sequence in the form as shown below advantages: all the requests can be seen, the results here in order to display data request, the latest request for displaying in the bottom

 

In summary, the two forms is different, structure suitable for a single series of access requests from the grasp of the macro, you can quickly locate. sequence for precise positioning of content, because each sequence has size, status and other attribute information, easily and quickly locate the results of this value.

Speaking for myself, the first tree more inclined to Charles, the list view good place fiddler than that: after repeatedly refresh request will be summarized to the tree inside, more clear, with a fiddler time, a little OCD students must click on the clear, there are wood ...

1.2.3 Toolbar Introduction

 

⑴~⑷ session

Charles had a conversation (session, does not refer to http in the session) concept can be understood as a browser tab, this function when you need to debug multiple pages of the site is very useful when you refresh the page, only the current capture session request.

(PS: ctrl + N to create a new session, ctrl + W closes the current session)

⑸ trash --- function is clear, clean out all requested information to display.

⑹ search keywords (the telescope) --- function is to search for keywords, you can use ctrl + f to achieve, you can set the scope of the search.

 

⑺ stop monitoring

 

--- function is arrested and brought to data or settings are not displayed. I think this is a very convenient tool charles, generally it is not displayed crawl status only when their own before and after the test of time, so that it is captured and displayed in the state. This Quick, Accurate access to the relevant information they want without having to look for a pile of data requests.

⑻ start / stop speed simulation

When testing, simulation speed will be used, the specific features described in the section behind, a little ..... here

⑼ open stop function breakpoint

⑽ refresh a single request

⑾ edit request

Editing editing, the request information may be modified in the following figure, modified after the click Execute request packet can be sent after a modification.

The results of the verification request ⑿

⒀ Tools

Set ⒁

1.2.4 Right menu request

Right-request menu, Charles's right-click menu function much stronger than the fiddler appeared.

 

1.2.5 Request Details

Request with details similar to the fiddler, but a lot of intuitive:

 

1.2.5.1 overview- request Overview

 

(1) URL (Uniform Resource Locator)

https: protocol scheme name

M.xxx.baidu.com: server address, here is resolvable DNS name. Colleagues may be ipv4d address name, may also be [0: 0: 0: 0: 0: 0: 0: 1] with such brackets is the name of IPV6 address.

App / getindexPage: level with the file path. File path on the server to locate specific to the resource.

Url path URL-- request, documents and query strings

Whether the state has been completed Status--

Notes-- Remarks

Response Code-- response status codes

The protocol used Protocol-- seesion (Http / https / ftp)

SSLssl-- protocol version number

Method-- methods (get / post / put, etc.) used in the seesion

Content-Type-- response content-type header

Timing :

The first byte time of the first request received Request Start Time--

Request End Time-- transmitted to the last client in response to the last byte of a

Response Start Time-- response start time

Response End Time-- end response time

Duration-- entire request - duration of response

The total time of the selected session DNS-- all it takes to resolve DNS

Connect-- the sum of all the selected session time established TCP / IP connection takes

Request-- request time-consuming

Response time consuming Response--

Size 

Request Header-- request header size

Response Header-- response header size

Request 

Response 

Total-- request response header byte header + size

1.2.5.2 request- request header

 

Glossary:

(1) Appid: In COM, the smallest unit of security controls that process, which has a corresponding security control strategy. Process control security policy stored in the registry, the storage location is: HKCR \ AppID \ access permissions, launch permissions and other security configuration information. When developing COM components can subkey COM CLSID under the corresponding components

New String type of item, name: AppID, values: AppID value of the process where the COM component.

channel: channel package Source

Contextuuid: device unique identifier

1.2.5.3 response- request result

Json format, refer to the specific meaning of the interface documentation. (Which is a state of the original raw data packet)

 

1.2.5.4 summary- request details including load time

 

1.2.5.5 timeline chart

 

1.3 Common functions
1.3.1 Analog speed function

Some of the online environment is usually caused because Suman bug, this unit can not reproduce, when it is thrown off balance, too remote trouble if recommended throttle.

Support for Bandwidth (Bandwidth), Utilistation (utilization percentage), Round-trip (round trip delay), the MTU (bytes) configuration, and support for 3G / 4G networks or other pattern.

! If we want to simulate a slow network designated site, you can then check the image above "Only for selected hosts" entry, then add the hosts entry can be specified in the lower half of the dialog box settings.

 

ADSL: belongs to DSL technology, the full name of Asymmetric Digital Subscriber Line (Asymmetric Digital Subscriber Line), also referred to as asymmetric digital subscriber loop. It is a new data transmission.

VDSL: is a non-symmetric DSL technology, stands for Very High Speed ​​Digital Subscriber Line (Very High Speed ​​Digital Subscriber Line). And as ADSL technology, VDSL also use twisted pair to transmit voice and data. VDSL is using the existing telephone line installation VDSL, simply install a VDSL Modem on the user side. The most important thing is no need for broadband Internet access and re-laid or change lines.

Isdn: ISDN (Integrated Services Digital Network, ISDN) is a digital telephone network to international standards, is a typical circuit-switched network. In the ITU's recommendations, ISDN is a development on the basis of a digital telephone network IDN on communications networks, ISDN can support multiple services, including telephone and non-telephone service business.

1.3.2 Modify network request content

Charles and may conveniently be modified network requests retransmission function. This can also be solved us, seek to modify its lattice request, or repeatedly try different needs of network parameters of the request. It is: only need to right-click on the conventional network requests, select "Edit" / click on the pencil icon, you can create a network request editable. As follows:

 

We can modify any of the requested information, including the URL address, port, and other parameters, and then click on "Execute" request to send the network after the modification (shown below). Charles Support us many changes and send the request.

 

1.3.3 Repeat request transmission network

(1) Repeat: This feature This feature is particularly useful for testing students can test the robustness of the interface. For the value of the front end is without a page refresh, just repeat the request, such as inspection agency was successful, the implementation of the revised request and so on. Usage: selection request, right Repeat request is repeatedly transmitted once. 

(2) Advanced Repeat customize repetition interval and number of repetitions, a request is repeatedly transmitted a plurality of times. You can easily test the server's concurrent processing capability, as follows: we want to suppress on the network's request (POST or GET request can) Right-click, then select "Repeat Advanced" menu item. Then in the dialog box, select the number of concurrent threads to suppress and suppress the number of times, then OK, you can begin to suppress. (Iteration: Iterations, Concurrency: concurrent, repeat time interval).

 

1.3.4 modify the server returns the content

Sometimes we want the server to return a number of specified content, to help us debug some special cases. For example, the page list is empty, the abnormality data, time-consuming part of the network request has timed out and the like. Without Charles, to the server with the appropriate data structure appears to be too much trouble. This time, using Charles-related functions to meet our needs.

Depending on the demand, Charles offers Map function, Rewrite function and Breakpoints function, you can achieve the purpose of modifying the server returned content. These three differences in function is:

△ Map function for a long period of redirecting some of the request to another network address or a local file.

△ Rewrite function request to the network for some regular replacement.

△ Breakpoints function suitable for some temporary changes.

1.3.4.1 MAL

In Charles' menu, select "Tools" -> "Map Remote" or "Map Local" to enter the settings page corresponding functions.

(1)map remote

For Map Remote function, we need to fill are the source and destination addresses of the network redirector, the conditions need not be limited to, and can be left blank.

 

(2)map local

For Map Local function, we need to fill redirect local source address and destination file. For some complex network requests result, we can first use the "Save Response ..." Charles offers features that will save the results to a local request (as shown below), then slightly modified, as our target map file.

the way is:

1. Request Right -save response, then there is another somewhere in their computer (file attribute must be .txt)

2. Request Right / tools-MAPlocal, then you just add the saved file, click OK to save

 

3. Right request, selecting repeat

4. refresh the app's page, you will see the data has been modified over.

5. Remove the proxy configuration: Tools-Maplocal can uncheck

 

1.3.4.2  Rewrite

Map Local when in use, there is a potential problem is that it returns Http Response Header normal request is not the same. This time if the client part of the check in Http Response Header, so that the function will fail. The solution is to use Map Local Rewrite the following mentioned functions, the relevant Rewrite Http head into our desired content.

Rewrite function suitable for a certain type of network function request some regular replacement, for the purpose of modifying the results.

For example: Our client has an API request is to get the user nickname, and my current nickname is "XXXX". We want to try to directly modify the return value of the network, the "XXXX" replaced with "test test."

The steps are:

1. Select request, and select the right Tools- rewrite function;

2. In the dialog pop, select the add-rules

 

3. After completion of setting, right request, selecting repeat. Then we can see from Charles, the nickname after the API is automatically obtained Rewrite the ultimate test of the test, as shown below:

 

1.3.5 Break functions (Breakpoints)

Rewrite function provided above most suitable for batch and long-term replacement, but many times, we just want to temporarily modify a network request, before this time, although the use of Rewrite function also can achieve the purpose, but too much trouble for temporary modifications, we'd better use Breakpoints function.

Breakpoints, when the specified network request occurs, Charles intercepts the request, this time, we can return the requested content in Charles temporary modification of the network.

Charles can be off before the transmission request (tampering Request) and the request (tampering Response).

Use breakpoints modification request of the drawbacks is that if the development is set request timeout, then modify the often slow even returned no effect, so the actual test method used in this scenario is not much.

Here to modify my ticket in the amount of 13.00 yuan as an example:

(1) Interface for the right to select "BreakPoints", so that this interface will be added to the breakpoint state;

 

(2) the need to further modify the properties of a breakpoint, you can in the menu bar "Proxy" - add> "Breakpoints Settings" in deleted or modified, and you can select the breakpoint in the request or response, or both. Here are just modify the response

 

(3) to refresh the app interface, jump to break the template, this time you can modify the request in the case of the corresponding state or response, then click on the button below "Execute". Opening the Edit Response screen, select JSON format, the format is clear, easy to modify, modify data directly above, into the data you want to test, then click the Execute button

 

(4) again to refresh the app interface, then the app returns the data for the new reform, the return data is correct based on the test client display

 

1.3.6 View ip proxy to connect the machine charles

 

Here you can see the connection myself charles proxy IP, for certain unwanted / unknown user, click to remove

Guess you like

Origin www.cnblogs.com/chenxiyuxiao/p/11007488.html