Support HTTP proxy and fixed an encoding bug