Search code examples
c++thrift

How to force Thrift to only accept connections from the localhost


I have a Java application that spins up multiple c++ processes. It communicates with these processes via Thrift RPC. For security purposes, I'd like to force the Thrift servers (c++ processes) to only accept connections from the localhost. I assumed it would be easy to bind the thrift socket to the loopback address, but after some googling I have not found an adequate solution. Am I missing something? Is there a way to bind thrift connections to an ip?

Thank you


Solution

  • Not with builtin tools.

    There is a concept of "processor events" implemented for certain language bindings. Not sure if they are for Java, but that could be worth a try.

    Another apoproach would involve the creation of a customized TTransport implementation that checks the incoming connection.