How do I use SOCKS proxy in delphi?
TCP
======
For Indy 8.0
In Delphi, do the following:
IdTCPClient1.SocksInfo.Host := [the DNS name of the proxy server or its IP address]
IdTCPClient1.SocksInfo.Protocol := [svNoSocks for no SOCKS support, svSocks4 for SOCKS 4, svSocks4A for SOCKS 4 with protocol extension, and svSocks5 for SOCKS 5 protocol]
IdTCPClient1.SocksInfo.Authentication := [saNoAuthentication for no SOCKS authentication or saUsernamePassword for username and password authentication]
In C++Builder, do the following:
IdTCPClient1->SocksInfo->Host = [the DNS name of the proxy server or its IP address]
IdTCPClient1->SocksInfo->Protocol = [svNoSocks for no SOCKS support, svSocks4 for SOCKS 4, svSocks4A for SOCKS 4 with protocol extension, and svSocks5 for SOCKS 5 protocol]
IdTCPClient1->SocksInfo->Authentication = [saNoAuthentication for no SOCKS authentication or saUsernamePassword for username and password authentication]
For Indy 9.0
1. Create an IOHandler such as TIdIOHandlerSocket or TIdSSLIOHandlerSocket and assign the TCPClient.IOHandler property this.
2. Create a TIdSocksInfo object and assign it to the IOHandler's SocksInfo property.
3. Set the TIdSocksInfo properties as required.
For Indy 10
1. Create an IOHandler such as TIdIOHandlerStack or SSL IOHandler and assign the TCPClient.IOHandler property this.
2. Create a TIdSocksInfo object and assign it to the IOHandler's TransparentProxy property.
3. Set the TIdSocksInfo properties as required.
4. If there is another proxy that the SOCKS Proxy itself needs to use, you have to use, set the Chained Proxy to a TIdCustomTransparentProxy such as TIdSocksInfo for another socks Proxy or a TIdConnectThroughHttpProxy for a HTTP Tunneling proxy.
UDP
======
Starting with Indy 10 build 51, we introduced the ability to use a SOCKS with UDP. However, this will only work with SOCKS protocol version 5 and the proxy server must support the UDP Associate method described in RFC 1928 - SOCKS Protocol Version 5.
1. Create a TIdSocksInfo object and assign it to the TIdUDPClient.TransparentProxy property.
2. Set the TIdSocksInfo properties as required.
3. Call TIdUDPClient.OpenProxy just before you use any receive or send calls.
4. After completing all of your receive and send calls, call TIdUDPClient.CloseProxy.
or if you are using the optional TIdUDPClient.Connect and TIdUDPClient.Disconnect methods, you can simply:
1. Create a TIdSocksInfo object and assign it to the TIdUDPClient.TransparentProxy property.
2. Set the TIdSocksInfo properties as required.
3. Call the TIdUDPClient.Connect method and it will open a connection to your proxy and call TIdUDPClient.Disconnect to close the connection to the proxy.
How do I use SOCKS proxy in delphi?的更多相关文章
- 使用netty构建一个socks proxy
使用netty构建一个socks proxy 最近在做的项目,需要自己搭建一个socks代理.netty4.0附带了一个socks代理的样例,但是3.x就没有这个东西了,碰巧使用的又是3.7,就只 ...
- Setup SS5 Socks Proxy
Install and configure ss5 socks proxy with simple authentication SS5 is a high performance socks pro ...
- 〖Linux〗转换Socks Proxy为Http Proxy
使用工具,privoxy,官网: http://www.privoxy.org/ socks5 proxy设定方法: autossh -CgNfD 0.0.0.0:1080 vps-lxb sock ...
- Delphi资源大全
A curated list of awesome Delphi frameworks, libraries, resources, and shiny things. Inspired by awe ...
- Awesome Delphi
Awesome Delphi A curated list of awesome Delphi frameworks, libraries, resources, and shiny things. ...
- 实现代理设置proxy
用户在哪些情况下是需要设置网络代理呢? 1. 内网上不了外网,需要连接能上外网的内网电脑做代理,就能上外网:多个电脑共享上外网,就要用代理: 2.有些网页被封,通过国外的代理就能看到这被封的网站:3. ...
- proxy解析
知其所以然 本文不是教程向,倾向于分析科学上网的一些原理.知其所以然,才能更好地使用工具,也可以创作出自己的工具. 科学上网的工具很多,八仙过海,各显神通,而且综合了各种技术.尝试从以下四个方面来解析 ...
- Set Java Proxy for Http/Https
Command Line JVM Settings The proxy settings are given to the JVM via command line arguments: java ...
- Configure apt-get / git/ curl to use a proxy (Ubuntu)
http://technoblog.org/2009/07/configure-apt-get-to-use-a-proxy-ubuntu/ Open the following configurat ...
随机推荐
- tomcat 内存配置
在bin目录下的catalina.bat里添加如下代码: rem ----- Execute The Requested Command ------------------------------- ...
- twitter bootstrap 2.x 3.x区别
栅格系统 (Grid system)说个我认为比较重要的,相对于RC 1中的3层,现在有4层了 We now have .col-xs (phones), .col-sm (tablets), .co ...
- android为应用程序添加退出动画
原本想搞一个退出程序时,把前一个应用程序的VIEW或者截图抓过来为我用,以实现更复杂的动画效果,尝试了很多方法,但都有或多或少的缺陷,可惜最后失败了.不过也算有所得.写文以标记. 其实抓图在4.0以后 ...
- HTML常用标签及其全称
<a href="#">a 超级链接(anchor)</a> <abbr title="abbreviation的简写"& ...
- bat拷贝文件
最近在部署服务器的时候,需要用到把一个站点文件拷贝到其他站点.一个一个手动copy太累人了,写了个简单的批处理文件,基本能达到目的,具体怎么做呢: 1.把需要拷贝到各个站点的文件,单独放到一个目录下. ...
- Android权限安全(13)4.3前后root原理不同
在JB MR2(4.3)之前 Apk内部可以通过Java的Runtime执行一个具有Root-setUID的可执行文件而 提升Effective UID来完成一些特权操作,典型的Root包中的su就是 ...
- css控制UL LI 的样式详解
用<ul>设置导航 <style> #menu ul {list-style:none;margin:0px;} #menu ul li {float:left;} </ ...
- UVa 11426 (欧拉函数 GCD之和) GCD - Extreme (II)
题意: 求sum{gcd(i, j) | 1 ≤ i < j ≤ n} 分析: 有这样一个很有用的结论:gcd(x, n) = i的充要条件是gcd(x/i, n/i) = 1,因此满足条件的x ...
- UVa 10837 (欧拉函数 搜索) A Research Problem
发现自己搜索真的很弱,也许做题太少了吧.代码大部分是参考别人的,=_=|| 题意: 给出一个phi(n),求最小的n 分析: 回顾一下欧拉函数的公式:,注意这里的Pi是互不相同的素数,所以后面搜索的时 ...
- UVa 10596 Moring Walk【欧拉回路】
题意:给出n个点,m条路,问能否走完m条路. 自己做的时候= =三下两下用并查集做了交,WA了一发-后来又WA了好几发--(而且也是判断了连通性的啊) 搜了题解= = 发现是这样的: 因为只要求走完所 ...