If http proxy is undefined, http_proxy function return undefined.
Fix http_proxy.
Add test scripts.
Refactoring.