class Proxy { public function __construct() { // establish connection to the original object } public function __call($method, $args) { // forward the call to the original object // using any protocol you need } }