IO handling and stuff

Hello all,
Im trying to figure out a way where by I can have a socket listener pass its traffic first thru a wrapper module before it hits the wire, likewise incoming requests will be stripped of fluff before being passed back to the original process.