Search code examples
delphidelphi-xe2indy

What is the equivalent server side component to TIdBlockCipherIntercept?


I want to encrypt some packets sent between a TIdTCPClient and a TIdTCPServer component. On the client side, I can use TIdBlockCipherIntercept to implement my encryption/decryption. But, I can't find the matching server side component to assign to my IdTCPServer, and I couldn't find anything on Google. What should I do?


Solution

  • In the absence of a TIdServerIntercept descendant, you can handle the OnConnect event and assign a TIdBlockCipherIntercept instance to the server connection's Intercept property.

    AContext.Connection.Intercept := TIdBlockCipherIntercept.Create(AContext.Connection);