Delphi transparent proxy for a TCP connection

烂漫一生 提交于 2019-12-30 09:52:18

问题


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.


回答1:


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.




回答2:


IPWorks from nSoftware should be considered as a commercial alternative to Synapse. They also have some Biztalk adapters available.

I've used both Synapse and IPWorks, and they are both quite good. I haven't used the referenced BizTalk adapters.

BizTalk Adapters

IPWorks



来源:https://stackoverflow.com/questions/941087/delphi-transparent-proxy-for-a-tcp-connection

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!