Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Delphi Indy TIdSocksServer未转发流量_Delphi_Indy_Socks - Fatal编程技术网

Delphi Indy TIdSocksServer未转发流量

Delphi Indy TIdSocksServer未转发流量,delphi,indy,socks,Delphi,Indy,Socks,我尝试创建一个SOCKS 4/5服务器,并且我想使用Indy TeaSoksServer 组件作为基础。它看起来很直接,使用起来也很简单,但我肯定遗漏了什么 我将一个tidsockserver放到一个新表单上,并配置了以下内容: 主动:正确 AllowSocks4:正确 AllowSock5:正确 绑定:0.0.0.0:43334 默认端口:80 截取:空 IOHandler:null 我添加了代码,以便在连接时在TMemo中显示'connect': procedure TForm1.Id

我尝试创建一个SOCKS 4/5服务器,并且我想使用Indy <代码> TeaSoksServer 组件作为基础。它看起来很直接,使用起来也很简单,但我肯定遗漏了什么

我将一个
tidsockserver
放到一个新表单上,并配置了以下内容:

  • 主动:正确
  • AllowSocks4:正确
  • AllowSock5:正确
  • 绑定:0.0.0.0:43334
  • 默认端口:80
  • 截取:空
  • IOHandler:null
我添加了代码,以便在连接时在
TMemo
中显示
'connect'

procedure TForm1.IdSocksServer1Connect(AContext: TIdContext);
begin
  Memo1.Lines.Add('connect');
end;
我在Linux主机上配置了ProxyChains:

/etc/proxychains.conf

。。。
袜子5 10.0.0.56 43334
当我执行应用程序并尝试使用ProxyChains连接时,出现以下错误:

kelly@ubuntu:~/home$proxychards www.google.com
ProxyChains-3.1(http://proxychains.sf.net)
|DNS请求| www.google.com

|S-chain |--10.0.0.56:43334--4.2.2.2:53-Remy发现了我的代码存在的问题。为了验证服务器是否正在接收连接,我添加了一个过程,该过程会写入TMemo组件,从而导致死锁。为了修复这个错误,我所要做的就是删除更新TMemo组件的过程。按预期工作。

错误反映超时。Indy TCP服务器是多线程的,像
OnConnect
这样的事件是在工作线程中触发的,从主UI线程外部访问VCL/FMX UI控件是不安全的,因此很可能会导致死锁。如果删除备忘录消息,或者至少将其正确同步到主UI线程,问题是否会消失?能否提供代理链和
tidsockserver
之间连接的Wireshark捕获?SOCKS流量在失败之前实际到达的距离有多远?正在激发的
OnBeforeSocksConnect
事件的
VHost
参数是否设置为
'www.google.com'
OnException
事件是否被触发?谢谢你,雷米。你的第一个评论就指出了这个问题。我一删除TMemo访问权限,问题就消失了。要在服务器事件中安全地访问
TMemo
,您只需与主UI线程同步,例如通过
TThread.Synchronize()
/
TIdSync
TThread.Queue()
/
TIdNotify
,或您选择的任何其他线程间通信。