Change host and path if proxy set
final version