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 ...
随机推荐
- PCL—低层次视觉—关键点检测(NARF)
关键点检测本质上来说,并不是一个独立的部分,它往往和特征描述联系在一起,再将特征描述和识别.寻物联系在一起.关键点检测可以说是通往高层次视觉的重要基础.但本章节仅在低层次视觉上讨论点云处理问题,故所有 ...
- lightOJ 1172 Krypton Number System(矩阵+DP)
题目链接:http://lightoj.com/volume_showproblem.php?problem=1172 题意:一个n进制(2<=n<=6)的数字,满足以下条件:(1)至少包 ...
- oracle db shutdown immediate–multi Instance
[oracle@redhat4 ~]$ sqlplus / as sysdba@orcl SQL*Plus: Release 11.2.0.1.0 Production on Tue Oct 6 21 ...
- Redis系列文章导读
1. Redis简介 1.1 Redis VS Memcached 2. Redis安装教程 3. Redis数据类型 4. Redis常用命令 4.1 key 4.2 string 4.3 hash ...
- zoj 3785 What day is that day? (打表找规律)
题目 思路:比赛的时候有想过找循环节,但是,打表打错了. 后来,看着过了挺多人,就急了, 看了一下别人的时间 耗时都挺长的,就以为不是找规律, 没想到真是找规律,不过,这个题的数据可能挺大的. AC代 ...
- Android系列之Fragment(一)----Fragment加载到Activity当中
Android上 的界面展示都是通过Activity实现的,Activity实在是太常用了.但是Activity也有它的局限性,同样的界面在手机上显示可能很好看, 在平板上就未必了,因为平板的屏幕非常 ...
- bzoj1266: [AHOI2006]上学路线route
最短路+最小割 首先如何使最短路变长?就是要每一条最短路都割一条边. 我们求出每个点到点1和点n的距离,就可以知道哪些边在最短路上(一开始没有想到求到0和n的距离,想用floyd,但是n=500,怕超 ...
- Asp.Net读写XML简单方法
xml文件 <?xml version="1.0" encoding="utf-8"?> <book> <title>web ...
- codevs 1172 Hankson 的趣味题
woc....这题考细节处理.要注意代码的逻辑顺序还有不要作死地循环到sqrt+1. #include<iostream> #include<cstdio> #include& ...
- Brew 编译mod错误Error: L6265E: Non-RWPI Section libspace.o(.bss) cannot be assigned to PI Exec region ER_ZI
Error: L6265E: Non-RWPI Section libspace.o(.bss) cannot be assigned to PI Exec region ER_ZI.: Error: ...