Sometimes for privacy reasons, we want to hide our IP so that the http server cannot record that we have accessed it, and then we can use a proxy server.
Proxy Server is a service application that works between the browser and the http server, and all http requests that pass through the proxy server will be forwarded to the corresponding http server.
Of course, in addition to HTTP proxy, https, ftp, RTSP, pop3 and other protocols can also be accessed by proxy, but this article introduces proxies that support http and https protocol access.
1. Proxy server classification:
There are two main types of proxies that are commonly used and support the HTTP(S) protocol: HTTP proxies and SOCKS proxies, see the following table:
Category | Subcategory | Subcategories | description | | http proxy | http proxy https proxy | Transparent proxy | The http server knows that the browser uses a proxy and can obtain the original IP address of the browser. | | Anonymous agents | The http server knows that the browser uses a proxy, but cannot obtain the original IP address of the browser side. | | High anonymity proxies | The http server does not know that the browser side uses a proxy and cannot obtain the original IP address of the browser side. | | SOCKS Agent | SOCKS4 | Known as the Almighty Generation Reason, support http and other agreements | Only TCP applications are supported. | | SOCKS4A | Support TCP applications; Server-side domain name resolution is supported. | | SOCKS5 | Support TCP and UDP applications; Server-side domain name resolution is supported. Support multiple authentications; IPV6 support; |
2. Linux curl command proxy setting parameters:
The Linux curl command can use the following parameters to set the HTTP(S) proxy and SOCKS proxy, and their usernames, passwords, and authentication methods have been set:
parameter | usage | -x host:port -x [protocol://[user:pwd@]host[:port] --proxy [protocol://[user:pwd@]host[:port] | Access using HTTP proxy; If no port is specified, port 8080 is used by default. protocol defaults to http_proxy, other possible values include: http_proxy、HTTPS_PROXY、socks4、socks4a、socks5; As: --proxy 8.8.8.8:8080; -x "http_proxy://aiezu:123@aiezu.com:80" | --socks4 <host[:port]> --socks4a <host[:port]> --socks5 <host[:port]> | Use SOCKS4 agents; Use SOCKS4A agents; Use SOCKS5 agents; This parameter overrides the "-x" parameter; | --proxy-anyauth --proxy-basic --proxy-diges --proxy-negotiate --proxy-ntlm | Agent authentication methods, reference: --anyauth --basic --diges --negotiate --ntlm | -U <user:password> --proxy-user <user:password> | Set the proxy's username and password; |
3. Linux curl command setting proxy example:
1. Linux curl command to set HTTP proxy:
2. Linux curl command to set the socks agent:
Original address:The hyperlink login is visible.
|