1. fix compilation error on mac; 2. implemented a template method of write in Connection
cross GFW proxy