i wish to write a code to build a proxy, to be able receive and send the message to the requested address or receiver with possibility to make filtering.

I have no idea how to do that, and what will be the first step to achieve my goal.

Any suggestion?