What is a proxy server
A Web proxy server is an intermediary entity of a network. The agent sits between the Web client and the Web server and acts as a "middleman" role.
The proxy server for HTTP is the Web server and the Web client.
Fiddler is a typical agent.
Fiddler works in the form of a proxy Web server that uses proxy addresses: 127.0.0.1, Port: 8888. When Fiddler quits, it automatically logs out the agent, so it doesn't affect other programs.
The role of Agent one, over the wall
Many people like to use Facebook to watch YouTube. But we are in celestial, celestial have the Great of Wall (Great Wall Firewall), shielding these good websites. What to do? Through the agent to jump over the jumps, you can visit.
To find their own proxy server is very troublesome, the general is to use the wall software to automatically discover the proxy server.
Role of Agent two, anonymous access
Often listen to the news, said "So-and-so" posted on the network posts, was in the province after the hunt. If he uses anonymous proxy server, it is not easy to expose his identity.
The anonymity of an HTTP proxy means that the HTTP proxy server hides the original user's IP address and other details from the remote server by deleting the identity attribute in the HTTP message (such as the client's IP address, or the cookie, or the session ID of the URI). Also, the log of the original user's access record is not logged on the HTTP proxy server (otherwise it is also detected).
Agent's role three, through the proxy internet
For example, LAN can not surf the internet, only through a local network proxy server online.
Agent's role four, through proxy caching, speed up the speed of the Internet
Most proxy servers have caching capabilities, like a large cache, it has a lot of storage space, and it keeps storing new data on its local storage, and if the browser is requesting data that already exists on its native memory and is up to date, it will not get data back from the Web server. and directly to the memory of the data to the user's browser, this can significantly improve the browsing speed.
Role of the agent five: child filters
Many educational institutions use filter agents to prevent students from accessing adult content.
IE proxy settings: Manually set up the agent
IE browser can set the agent manually, very simple, specify an IP address and port on it. The following figure.
Tools-> Internet Options-> connection-> LAN settings (shortcut keys)
If the IP address of the proxy server has changed, or the port number has changed. Do you want hundreds of client browsers to modify the browser settings? Impossable It's too hard to maintain. Here's a more advanced approach.
IE proxy settings: Using automatic configuration Scripts (PAC)
Manually configuring the agent is simple, but inflexible. Only one proxy server can be specified, and failover is not supported.
In large companies, a PAC file is typically used for configuration. Just specify the URL of the PAC file, as shown in figure:
The PAC (Proxy Auto Config) file is a text file for a small JavaScript program with a suffix of. dat.
When the browser accesses the network, the appropriate proxy server is selected according to the JavaScript function in the PAC file.
Contents of Sample_pac.dat File
function FindProxyForURL (URL, host) { if (url.substring (0, 5) = = "http:") {// The specified proxy return
"proxy proxy:80 " should be used. Else if (url.substring (0, 4) = = "ftp:") {return "PROXY fproxy:80" ; } Else if (url.substring (0, 7) = = "Gopher:") {return "PROXY gproxy" ; } Else if (url.substring (0,
6) = = "https:") {return "PROXY secproxy:8080"; } Else { // direct connection without any proxy return
"direct"; }
IE proxy settings: Automatic detection settings (WPAD)
The browser can use the WPAD protocol whenever you select automatic detection settings, and WPAD will automatically find the URL of the PAC file. WPAD will use a series of resource discovery techniques (DHCP,DNS, etc.) to look for PAC files.
Agent authentication, and 407 status codes
Proxy servers can also require authorization, and HTTP defines a mechanism called proxy authentication (authentication). This mechanism can block requests for content.
When the browser accesses a proxy that requires authentication, the proxy server returns 407 Authorization Required, telling the browser to enter a username and password.
Agent authentication and HTTP Basic authentication is the same mechanism, if you need to understand the mechanism of proxy authentication, please see [HTTP protocol Basic authentication]
Security issues using a proxy server
Proxy servers and grab kits, such as Fiddler, can see the data in the HTTP request. If we send a request with sensitive data, such as user name, password, credit card number. This information will be seen by the proxy server. So it's very dangerous. So we generally use HTTPS to encrypt the HTTP request. So the proxy server can not see the data inside.
How to build a proxy server
You can use Ccproxy, and squid to build a proxy server.