官术网_书友最值得收藏!

Case 2 – with a proxy 

When we make the request with a proxy, the browser only connects to the proxy and not the actual website. So, the difference in the commands is as follows: 

telnet <Proxy IP> <Proxy Port> 
GET http://www.google.com/ HTTP/1.1
Host: www.google.com
Connection: Close

As we can see, instead of sending only the / as a parameter to the GET, we send the full URL, so that the proxy server can make the request on our behalf. 

This will work for HTTP (unencrypted), however for HTTPS the telnet utility shouldn't be used for testing, the openssl command should be used. 

A sample of the HTTPS connection is shown as follows (provided openssl is installed on your terminal). 

We will use the s_client or the secure client in the OpenSSL library. The command is shown as follows (used instead of telnet <ip> <port> shown in the preceding example):
openssl s_client -connect www.google.com:443.

This will then establish a secure channel to the server (by agreeing on the cipher, verifying the certificate, and changing the cipher spec). Once it is done, you can continue to use the HTTP commands as before (GET, Host, Connection, and so on).

主站蜘蛛池模板: 嘉义县| 水富县| 浏阳市| 铁岭县| 青海省| 晋宁县| 洪泽县| 两当县| 东兰县| 探索| 安溪县| 农安县| 名山县| 靖州| 长白| 阳春市| 毕节市| 游戏| 宁阳县| 元朗区| 集贤县| 青阳县| 西林县| 丹棱县| 黄平县| 冷水江市| 桂阳县| 潞西市| 凤庆县| 西华县| 常州市| 延庆县| 榆社县| 灵寿县| 凯里市| 东台市| 子长县| 巴林右旗| 佛坪县| 固安县| 竹北市|