Refactor non proxy hosts handling, fix #202 in 1.7.x