青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

elva

HTTP Tunneling

Introduction

HTTP Tunneling

HTTP is a text-based protocol to retrieve Web pages through a Web browser. Mostly, if you are on a LAN connection, you are behind a proxy server; this proxy server has one HTTP proxy running on some defined port. In your Internet Explorer's Connection option, you specify LAN settings as required. This proxy server is definitely running on a text-based protocol, and you can only get HTTP-related data from the outside network, right!! Well, there is a small loophole from which you can go through HTTP and connect to the outside world and get any data you want in binary protocol, or even your own protocol. It's through HTTPS.

HTTPS Explanation

In HTTPS, data is transferred from browser to server and server to browser in a secure manner. It's a binary protocol; when it goes through a proxy, the proxy doesn't understand anything. The proxy just allows a binary stream to open and lets both server and client exchange the data. Now, we can fool the proxy server and connect to any server and exchange data. The proxy server will think that we are doing some secure HTTP session.

For HTTPS, your browser connects to a proxy server and sends a command:

CONNECT neurospeech.com:443 HTTP/1.0 <CR><LF>
HOST neurospeech.com:443<CR><LF>
[... other HTTP header lines ending with <CR><LF> if required]>
<CR><LF>    // Last Empty Line

Then, the proxy server treats this as some HTTP Secure Session, and opens a binary stream to the required server and port as defined. If a connection is established, the proxy server returns the following response:

HTTP/1.0 200 Connection Established<CR><LF>
[.... other HTTP header lines ending with <CR><LF>..
ignore all of them]
<CR><LF>    // Last Empty Line

Now, the browser is connected to the end server and can exchange data in both a binary and secure form.

How to Do This

Now, it's your program's turn to fool the proxy server and behave as Internet Explorer behaves for Secure HTTP.

  1. Connect to Proxy Server first.
  2. Issue CONNECT Host:Port HTTP/1.1<CR><LF>.
  3. Issue <CR><LF>.
  4. Wait for a line of response. If it contains HTTP/1.X 200, the connection is successful.
  5. Read further lines of response until you receive an empty line.
  6. Now, you are connected to the outside world through a proxy. Do any data exchange you want.

Sample Source Code

Collapse
  // You need to connect to mail.yahoo.com on port 25
// Through a proxy on 192.0.1.1, on HTTP Proxy 4480
// CSocketClient is Socket wrapping class
// When you apply operator << on CString, it writes CString
// To Socket ending with CRLF
// When you apply operator >> on CString, it receives
// a Line of response from socket until CRLF
try
{
CString Request,Response;
CSocketClient Client;
Client.ConnectTo("192.0.1.1",4480);
// Issue CONNECT Command
Request = "CONNECT mail.yahoo.com:25 HTTP/1.0";
Client<<Request;
// Issue empty line
Request = "";
Client<<Request;
// Receive Response From Server
Client>>Response;
// Ignore HTTP Version
int n = Response.Find(' ');
Response = Response.Mid(n+1);
// Http Response Must be 200 only
if(Response.Left(3)!="200")
{
// Connection refused from HTTP Proxy Server
AfxMessageBox(Response);
}
// Read Response Lines until you receive an empty line.
do
{
Client>>Response;
if (Response.IsEmpty())
break;
}while (true);
// Coooooooool.... Now connected to mail.yahoo.com:25
// Do further SMTP Protocol here..
}
catch (CSocketException * pE)
{
pE->ReportError();
}

Library Source Code

The Dns.h file contains all DNS-related source code. It uses other libraries, as SocketEx.h, SocketClient.h, and NeuroBuffer.h.

CSocketEx

Socket functions as a wrapper class. (CSocket is very heavy and unreliable if you don't have the exact idea of how it works.) All the functions are of the same name as CSocket. You can use this class directly.

CSocketClient

Derived from CSocketEx and throws proper exceptions with details of Winsock errors. It defines two operators, >> and <<, for easy sending and receiving; it also changes network to host and host to network order of bytes if required.

CHttpProxySocketClient

Derived from CSocketClient, you can call the SetProxySettings(ProxyServer,Port) method and set proxy settings. Then, you can connect to the desired host and port as you need. The ConnectTo method is overridden, and it automatically implements an HTTP proxy protocol and gives you a connection without any hassle.

How to Use CHttpProxySocketClient

Collapse
  // e.g. You need to connect to mail.yahoo.com on port 25
// Through a proxy on 192.0.1.1, on HTTP Proxy 4480
// CSocketClient is Socket wrapping class
// When you apply operator << on CString, it writes CString
// To Socket ending with CRLF
// When you apply operator >> on CString, it receives
// Line of response from socket until CRLF
try
{
CHttpProxySocketClient Client;
Client.SetProxySettings("192.0.1.1",1979);
// Connect to server mail.yahoo.com on port 25
Client.ConnectTo("mail.yahoo.com",25);
// You now have access to mail.yahoo.com on port 25
// If you do not call SetProxySettings, then
// you are connected to mail.yahoo.com directly if
// you have direct access, so always use
// CHttpProxySocketClient and no need to do any
// extra coding.
}
catch(CSocketException * pE) {
pE->ReportError();
}

Note: I usually don't program in the form of .h and .cpp different files, because using them the next time somewhere else is a big problem because you must move both files here and there. So, I put all the code in my .h file only; I don't write to the .cpp file unless it's required. You need to copy only the SocketEx.h, SocketClient.h, and HttpProxySocket.h files into your project's directory, and add line:

#include "HttpProxySocket.h"

after your:

#if !defined(.....

and so forth code of your Visual Studio-generated file. If you put anything above this, you will get n number of errors.

 

posted on 2007-05-06 16:51 葉子 閱讀(709) 評論(0)  編輯 收藏 引用 所屬分類: 網絡安全

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            欧美在线精品免播放器视频| 久久人91精品久久久久久不卡| 亚洲三级毛片| 亚洲一级在线| 亚洲国产三级| 艳女tv在线观看国产一区| 久久久久久久一区二区| 国产精品久久久久一区| 99re视频这里只有精品| 欧美a一区二区| 欧美在线日韩| 国内外成人免费视频 | 韩国美女久久| 久久久999精品免费| 亚洲欧美日韩另类| 国产精品亚洲成人| 欧美一级片一区| 欧美一级电影久久| 国产一区久久| 久久日韩粉嫩一区二区三区| 欧美亚洲在线视频| 狠狠色丁香久久婷婷综合丁香| 久久久www成人免费精品| 亚洲欧美国产高清| 国产精品午夜国产小视频| 欧美一区二区观看视频| 亚洲夜晚福利在线观看| 亚洲破处大片| 欧美日韩一区二区三| 亚洲图片在线| 午夜精品久久久久久| 狠狠色狠狠色综合日日小说| 欧美成人精精品一区二区频| 女生裸体视频一区二区三区| 日韩午夜黄色| 亚洲视频www| 国内精品久久久| 亚洲国产高潮在线观看| 欧美色图五月天| 欧美在线|欧美| 久久久在线视频| 日韩一级免费| 午夜激情亚洲| 亚洲人久久久| 亚洲自拍偷拍视频| 影音先锋久久精品| 亚洲精品在线观看免费| 国产欧美日本一区视频| 免费久久精品视频| 欧美午夜无遮挡| 麻豆久久婷婷| 国产精品久久久久aaaa九色| 玖玖综合伊人| 国产精品红桃| 欧美r片在线| 国产精品日韩一区二区| 欧美高清在线精品一区| 国产精品性做久久久久久| 免费观看一级特黄欧美大片| 国产精品久久久久国产a级| 欧美xx69| 国产精品网站在线观看| 欧美激情a∨在线视频播放| 国产精品拍天天在线| 亚洲国产精品一区| 国产精品草莓在线免费观看| 麻豆精品传媒视频| 国产精品日日摸夜夜添夜夜av| 亚洲成人在线网| 国产亚洲综合精品| 在线亚洲高清视频| 99精品欧美一区| 美女精品国产| 两个人的视频www国产精品| 国产精品国产成人国产三级| 亚洲国产精品久久久久秋霞影院| 国产亚洲精品aa| 中文一区在线| 夜夜嗨av一区二区三区中文字幕| 久久亚洲春色中文字幕| 亚洲你懂的在线视频| 欧美日韩精品一区二区三区四区| 欧美国产日本高清在线| 在线观看日韩专区| 欧美一区二区三区久久精品| 性欧美大战久久久久久久免费观看| 欧美日韩国产一区精品一区 | 鲁大师成人一区二区三区 | 亚洲综合视频一区| 国产欧美91| 在线综合亚洲| 亚洲午夜羞羞片| 欧美日韩亚洲不卡| 最新国产精品拍自在线播放| 亚洲国产精品久久久久秋霞影院| 久久久精彩视频| 老鸭窝91久久精品色噜噜导演| 国产一区欧美日韩| 欧美一区永久视频免费观看| 久久精品亚洲一区二区| 国产午夜精品麻豆| 欧美一区三区三区高中清蜜桃| 久久er99精品| 国内一区二区三区在线视频| 午夜国产精品视频| 久久久久99| 亚洲第一成人在线| 美女尤物久久精品| 亚洲人成网站777色婷婷| 99精品视频免费全部在线| 欧美日本一区二区高清播放视频| 亚洲精品偷拍| 午夜精品一区二区三区在线播放| 国产欧美日韩亚州综合| 欧美专区在线播放| 噜噜噜噜噜久久久久久91 | 99riav国产精品| 亚洲免费在线观看| 国产三级欧美三级日产三级99| 久久精品首页| 亚洲激情六月丁香| 午夜精品久久| 好吊色欧美一区二区三区四区| 麻豆九一精品爱看视频在线观看免费| 亚洲国产精品精华液网站| 亚洲一区二区在线播放| 国产综合香蕉五月婷在线| 欧美大色视频| 午夜精品理论片| 欧美激情第二页| 亚洲欧美日韩在线不卡| 国产综合av| 欧美日韩国产成人在线免费| 午夜精品视频一区| 亚洲国产va精品久久久不卡综合| 亚洲男人av电影| 亚洲国内自拍| 国产欧美日韩一区二区三区在线 | 欧美国产日本| 亚洲欧美日韩一区| 亚洲国产精品t66y| 欧美一区二区免费视频| 亚洲日本中文字幕免费在线不卡| 国产精品毛片在线| 嫩草成人www欧美| 性欧美xxxx大乳国产app| 91久久久亚洲精品| 久久久久在线观看| 亚洲一区二区毛片| 亚洲精品国产精品国自产观看| 国产日韩欧美中文| 欧美视频在线免费| 欧美91福利在线观看| 欧美在线日韩| 亚洲综合电影一区二区三区| 亚洲精品少妇| 亚洲国产合集| 欧美成人福利视频| 麻豆国产精品777777在线| 国产精品你懂得| 91久久久一线二线三线品牌| 久久亚洲高清| 欧美亚洲一级片| 中文网丁香综合网| 亚洲精品久久久久| 亚洲成色最大综合在线| 国产亚洲在线| 国产亚洲综合在线| 国产午夜精品理论片a级大结局| 国产精品久久久久9999吃药| 欧美日韩精品二区| 欧美精品18+| 欧美激情一区三区| 蜜桃av一区二区在线观看| 亚洲欧美综合| 亚洲欧美日韩中文在线制服| 亚洲少妇在线| 在线亚洲精品| 亚洲伊人久久综合| 亚洲免费在线播放| 亚洲欧美日韩久久精品| 欧美一区二区视频在线观看2020| 亚洲女性裸体视频| 亚洲欧美电影院| 久久成年人视频| 久久久亚洲欧洲日产国码αv| 久久成人亚洲| 久久九九精品| 奶水喷射视频一区| 欧美成人一区在线| 欧美日韩一二三四五区| 国产精品v欧美精品v日本精品动漫| 欧美日韩在线播| 国产精品久久7| 国产精品私拍pans大尺度在线| 国产日韩欧美综合| 亚洲国产一区二区三区青草影视| 亚洲精品美女在线观看| 亚洲性线免费观看视频成熟| 午夜在线一区二区|