views:

957

answers:

2

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.

+5  A: 

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.

skamradt
Yes, I am looking for a straightforward TCP socket implementation. The broker will actually sit between BizTalk and an ERP system so I know 100% the data is XML, but not framed as a HTTP request. I do use Synapse under D2009 and will have a look at the HTTP proxy. Thanks.
David Taylor
A: 

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

Darian Miller