some fixes for http proxy tunnel