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 ...
随机推荐
- Android Handler之Message传递参数
最近发现Message,发送消息可以传递参数,这个思路很好,所以写了一个例子,点击屏幕,给Activity发送一个消息,传递两个参数,并把这个activity销毁掉! 程序打开界面: 点击屏幕,销毁a ...
- 区分int a() 和 int a
事因 #include <iostream> using namespace std; struct A { A(int) {} A() {} void fun() {}; }; int ...
- PHP命名空间概念解析
1. PHP中的命名空间是什么? 什么是命名空间?“从广义上来说,命名空间是一种封装事物的方法.在很多地方都可以见到这种抽象概念.例如,在操作系统中目录用来将相关文件分组,对于目录中的文件来说,它就扮 ...
- linq to Entity 数据库除了有主键还有唯一索引,是不是不能更新
数据库建了一个唯一索引,使用linq to ef更新的时候,老是报,索引建冲突,,坑了我一上午,最后把索引删了
- TeeChart显示三维的图形,使用Surface
绘制一个球 根据公式x^2+y^2+z^2=R^2; 令x=RsinAcosB y=RcosAcosB z=RsinB using System; using System.Collections. ...
- oracle .bash_profile
[oracle@redhat4 ~]$ vi .bash_profile # .bash_profile # Get the aliases and functionsif [ -f ~/.bashr ...
- Delphi使用JSON解析调用淘宝IP地址库REST API 示例
淘宝IP地址库:http://ip.taobao.com,里面有REST API 说明. Delphi XE 调试通过,关键代码如下: var IdHTTP: TIdHTTP; RequestURL: ...
- 函数buf_read_page
/********************************************************************//** High-level function which ...
- Jqgrid入门-别具特色的Pager Bar (四)
Pager Bar位于表格最下边.默认情况下,分为三部分.如图: 第一部分:导航按钮栏(Navigator) 第二部分:页码栏(Pager) 第三部分:记录信息栏(Record) 要实 ...
- 随机变量的方差variance & 随机向量的协方差矩阵covariance matrix
1.样本矩阵 如果是一个随机变量,那么它的样本值可以用一个向量表示.相对的,如果针对一个随机向量,那么就需要利用矩阵表示,因为向量中的每一个变量的采样值,都可以利用一个向量表示. 然后,一个矩阵可以利 ...