refactor http proxy