Delphi透明代理TCP连接 [英] Delphi transparent proxy for a TCP connection

查看:192
本文介绍了Delphi透明代理TCP连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都知道使用Delphi编写的TCP sockets代理应用程序的任何示例?我正在构建一个需要监听给定TCP端口上的套接字连接的小型代理应用程序,读取通过连接发送的XML数据包,通过TCP将请求提供给从可用后端服务器池中选择的服务器,并提供所产生的响应返回到始发TCP连接。



我非常熟悉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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆