added proxy and tweaked local/remote_thr to support connect to the proxy, pub/sub, and check message order