Who Is The Agent In Http Protocol


The Agent

Agent, called as Networking Agent, network services are of special types that permits a network client via the service with another network terminal (usually a server) non-direct connection.

Some gateways, or the proxysite routers and other network equipment with network proxy capabilities. Agency services are generally believed to help protect the privacy or security of network conductors and prevent attacks.

Agency Services

Agency services computer systems or other types of network terminal called a proxy server. A complete proxy request process is as follows:

The client first establishes a connection with the proxy server, and then requests to establish a connection to the target server or obtain the specified resource (for example, a file) of the target server according to the proxy protocol used by the proxy server.

In the latter case, the proxy server may download the resource of the target server to the local cache. If the client wants to obtain the resource in the proxy server’s cache, the proxy server will not send the request to the target server but directly return cached resources.

Some proxy protocols allow the proxy server to change the client’s original request to the original response of the target server to satisfy the needs of the proxy site protocol.

Proxy server options and settings in a computer program typically include a “firewall” that allows the user to enter the proxy address, which covers their network activity and allows filtering across the Internet for network access.


Increase the speed of access: usually the proxy server is set to a larger buffer, when the outside information is passed, but also to save it to the buffer, when other users access the same information, then directly from the buffer remove the Information, passed to the user, in order to improve access speed.
Control access to internal resources:

If a university FTP (provided that the proxy address within the allowable access to the resources), the use of educational network address free proxy server, you can use for educational network open all kinds of FTP Download and Upload, as well as various types of information sharing and other services.

Filtering content:

For example, restrict access to specific computers, translating data from one language to another, or defending offensive access to both sides of a proxy server.

Hide real IP:

Internet users can also hide their own IP through the proxy server, from attack. However, it is difficult for only one agent to guarantee safety. A safer method is to use a specific tool to set up an agent chain.

Break their own IP access restrictions:

Visit foreign sites. China Education Network and 169 network users such as Internet users can visit foreign websites.

Break through the content filtering mechanism

To restrict access to filtered sites. Restrictions on internet access in China such as Great Firewall of Fire can be overcome by browsing through the proxy server.

But every time the National Day, the two sessions and other Sensitive period, the Great Firewall of the firewall will greatly enhance the blockade, most of the proxy server and proxy software will not be able to connect. (Such as: Tor, free door, unbounded browsing, etc.)

Proxy Site, HTTP Protocol Request Message Request

http protocol

HTTP request message request
The request message that the client sends an HTTP request to the server includes the following format:
It consists of four parts: request line, request header, blank line, and request data.
<br />
Http request message structure.png
• The request line begins with a method symbol, separated by a space, followed by the requested URI and the protocol version.
Get request example, use Charles to retrieve the request:
GET /562f25980001b1b106000338.jpg HTTP/1.1
Host img.mukewang.com on proxysite
User-Agent Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.106 Safari/537.36
Accept image/webp,image/*,*/*;q=0.8
Referer http://www.imooc.com/
Accept-Encoding gzip, deflate, sdch
Accept-Language zh-CN,zh;q=0.8
The first part: request line, used to indicate the type of request, the resources to access, and the HTTP version used.
GET indicates that the request type is GET, and [/562f25980001b1b106000338.jpg] is the resource to be accessed. The last part of the line indicates that the HTTP 1.1 version is used.
The second part: the request header, immediately after the request line (that is, the first line), used to depict additional information to be used by the server
From the second line to the request header, HOST will indicate the destination of the request. User-Agent, both server-side and client-side scripts can access it. It is an important basis for browser-type detection logic. This information is accessed by you. To define, and automatically send in each request, etc.
The third part: blank line, the blank line behind the request header is a must
Even if the fourth part of the request data is empty, there must be a blank line.
Part IV: The request data is also called the subject and any other data can be added.
The request data for this example is empty.
POST request example, using the request captured by Charles:
Host: www.wrox.com
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022)
Content-Length: 40
Connection: Keep-Alive
The first part: the request line, the first line is the post request, and the http1.1 version.
The second part: the request header, the second line to the sixth line.
The third part: blank line, blank line of the seventh line.
Part IV: Request Data, Eighth Line.
HTTP response message Response
Under normal circumstances, the server will return an HTTP response message after receiving and processing the request from the client.
The HTTP response also consists of four parts: the status line, the message header, the blank line, and the response body.
<br />
Http response message format.jpg
HTTP/1.1 200 OK
Date: Fri, 22 May 2009 06:07:21 GMT
Content-Type: text/html; charset=UTF-8
<!–body goes here–>
The first part: The status line consists of the HTTP protocol version number, status code, and status message.
The first behavior status line, (HTTP/1.1) indicates that the HTTP version is version 1.1, the status code is 200, and the status message is (ok)
The second part: The message header, used to explain some additional information to be used by the client
The second and third lines of message headers,
Date: The date and time the response was generated; Content-Type: Specifies the MIME type of HTML (text/html), the encoding type is UTF-8
The third part: blank line, blank line behind message header is required
Part IV: Response text, text information returned by the server to the client.
The html part behind the blank line is the response body.