资源简介
代理服务器(Proxy Server)是一种重要的安全功能,它的工作主要在开放系统互联(OSI)模型的对话层,从而起到防火墙的作用。代理服务器大多被用来连接INTERNET(国际互联网)和INTRANET(局域网)。
本客户端支持 socks4代理/ 5和HTTP 1.1代理连接.

代码片段和文件信息
/*CAsyncProxySocket by Tim Kosse (Tim.Kosse@gmx.de)
Version 1.3 (2001-12-13)
--------------------------------------------------------
Introduction:
-------------
This class is a CAsyncSocket derived class. With this class you
can connect through SOCKS4/5 and HTTP 1.1 proxies. This class works
as semi-transparent layer between you own class and CAsyncSocket.
This class is used in FileZilla a powerful open-source FTP client.
It can be found under http://sourceforge.net/projects/filezilla
For more information about SOCKS4/5 goto
http://www.socks.nec.com/socksprot.html
For more information about HTTP 1.1 goto http://www.rfc-editor.org
and search for RFC2616
How to use?
-----------
You don‘t have to change much in you already existing code to use
CAsyncProxySocket.
To use it you‘ve to derive you own class from CAsyncProxySocket and
you‘ve to provide a definition for OnProxyOperationFailed(int nOpID) and
OnListenFinished(unsigned long &retProxyIpint &retProxyPort)=0;
When you create an instance of your derived class you should call
SetProxy.
If you overload the OnReceive or OnConnect functions you have to call
CAsyncProxySocket::OnReceive and CAsyncProxySocket::OnConnect
as first instrucion in your OnReceive and OnConnect functions.
Sample code:
CMyClass::OnReceive(int nErrorCode)
{
CAsyncProxySocket::OnReceive(nErrorCode);
//Add you own implementation below:
...
}
If an operation fails OnProxyOperationFailed is called. There
you can handle the error. int nOpID specifies the type of the operation
that failed: PROXYOP_CONNECT when a connection attempt failed and
PROXYOP_LISTEN when creating a listen socket failed.
If you want to use CAsyncProxySocket to create a listen socket you
have to use this overloaded function:
virtual BOOL Listen(unsigned long serverIp);
serverIP is the IP of the server you are already connected
through the SOCKS proxy. You can‘t use listen sockets over a
SOCKS proxy without a primary connection. Listen sockets are only
supported by SOCKS proxies this won‘t work with HTTP proxies.
When the listen socket is created successfully OnListenFinished is
called. The parameters unsigned long &retProxyIp and int &retProxyPort
will tell you the ip and the port of the listen socket.
After it you have to handle the OnAccept message and accept the
connection.
Description of the new functions and their parameters:
------------------------------------------------------
void SetProxy(int nProxyType);
void SetProxy(int nProxyType CString ProxyHost int nProxyPort);
void SetProxy(int nProxyType CString ProxyHost int nProxyPortCString ProxyUser CString ProxyPass);
Call one of this functions to set the proxy type.
Parametes:
- nProxyType specifies the Proxy Type.
- ProxyHost and nProxyPort specify the address of the proxy
- ProxyUser and ProxyPass are only available for SOCKS5 proxies.
supported proxy types:
PROXYTYPE_NOPROXY
PRO
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2010-03-15 14:07 casyncproxysocket_demo\
文件 26426 2001-12-13 17:01 casyncproxysocket_demo\AsyncProxySocket.cpp
文件 8089 2001-12-13 14:58 casyncproxysocket_demo\AsyncProxySocket.h
文件 2480 2001-12-09 12:06 casyncproxysocket_demo\CAsyncProxyDemo.cpp
文件 4749 2001-12-12 13:59 casyncproxysocket_demo\CAsyncProxyDemo.dsp
文件 1493 2001-12-09 12:06 casyncproxysocket_demo\CAsyncProxyDemo.h
文件 7349 2001-12-13 15:06 casyncproxysocket_demo\CAsyncProxyDemo.rc
文件 894 2010-03-15 14:01 casyncproxysocket_demo\CAsyncProxyDemo.sln
文件 8745 2010-03-15 14:01 casyncproxysocket_demo\CAsyncProxyDemo.vcproj
文件 7544 2001-12-13 15:10 casyncproxysocket_demo\CAsyncProxyDemoDlg.cpp
文件 1773 2001-12-12 17:06 casyncproxysocket_demo\CAsyncProxyDemoDlg.h
文件 23460 2001-12-12 13:58 casyncproxysocket_demo\Cba
文件 1538 2000-01-04 20:39 casyncproxysocket_demo\Cba
文件 1687 2001-12-13 17:00 casyncproxysocket_demo\MySocket.cpp
文件 814 2001-12-12 17:00 casyncproxysocket_demo\MySocket.h
目录 0 2001-12-09 12:06 casyncproxysocket_demo\res\
文件 1078 2001-12-09 12:06 casyncproxysocket_demo\res\CAsyncProxyDemo.ico
文件 431 2001-12-09 12:06 casyncproxysocket_demo\res\CAsyncProxyDemo.rc2
文件 1382 2001-12-09 12:15 casyncproxysocket_demo\resource.h
文件 219 2001-12-09 12:06 casyncproxysocket_demo\StdAfx.cpp
文件 1188 2001-12-09 12:06 casyncproxysocket_demo\StdAfx.h
- 上一篇:JS基础练习题
- 下一篇:ADC0809芯片英文资料
相关资源
- http请求状态代码
- QT 实现文件下载
- 易语言 TCP使用HTTP、SOCKES5代理IP。
- http协议rfc2616中英文双版
- httpclient4.3工具类
- 地址转化器 迅雷,电驴,网盘,快车
- apache-httpd2.5安装及配置(包含教程及
- 易语言HTTP连接请求源码
- okHTTP与HTTPS
- IE7,IE8下也能用的Httpwatch
- pkavhttpfuzzer
- Http Analyzer 7(http抓包工具)7 7.6.4破解
- STM32+BC20通过HTTP传输GPS北斗定位到湖畔
- 易语言 HTTPS模块
- Netscaler中文配置手册.pdf
- 利用openssl和curl库获取https服务端证书
- 通过NodeJS中的http.get() 和 http.requ
- IDEA遇到Internal error. Please refer to http
- RFC2616的中文版
- http服务器测试工具
- 单片机HTTP通信
- 基于okhttp的网络框架
- (中文完整版)HTTP协议1.1.pdf
- HTTP权威指南[中英文对照阅读版].pdf
- 投票、刷票、模拟HTTP链接源码
- openssl-0.9.8k_WIN32.rar
- apache/httpd安全配置方法总结
- Apachehttpd-2.2.21-win32-x86-no_ssl.msi
- https://github.com/rmtheis/tess-two编译出来的
- OKHttp3的使用demo
评论
共有 条评论