Delphi透明代理TCP连接 [英] Delphi transparent proxy for a TCP connection
问题描述
我非常熟悉TCP和套接字级编程,但更愿意以示例代码为起点。如果有可用的话,这将节省大量的时间和精力,因为我不需要重塑轮子。我记得在2003/2004年前看到一个用Delphi编写的小型TCP代理,但似乎已经失去了链接。
Synapse 框架的内容会使这个项目相当简单。如果您抓住Synapse,请从SVN获取最新版本。它支持所有最新版本的Delphi。
有一个 httpproxy 演示可用于突触,这可能有助于您想要实现更传统的东西。也可以使用一个很好的起始http服务器示例。
Anyone know of any examples of a TCP sockets proxy application written in Delphi? I am building a small broker application that needs to listen for socket connections on a given TCP port, read a XML data packet sent over the connection, serve the request via TCP to a server chosen from a pool of available back end servers, and deliver the resulting response back to the originating TCP connection.
I am very familiar with TCP and socket-level programming, but would prefer to find sample code as a starting point. If there is something available it would save considerable time and effort since I would not need to reinvent the wheel. I recall seeing a small TCP proxy written in Delphi back in 2003/2004, but seem to have lost track of the link.
Are you looking for a socks proxy implementation? If not, then just start with a server (http would most likely be a good start) and build into it the ability to process your inbound XML data packet, and make the appropriate calls. Something like the Synapse framework would make that a fairly simple project. If you grab Synapse, get the latest version from SVN. It supports all of the latest versions of Delphi.
There is a httpproxy demo for synapse available, that might help if your wanting to implement something more traditional. A good starting http server example is also available.
这篇关于Delphi透明代理TCP连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!