diff --git a/src/proxy.ts b/src/proxy.ts index 8a9a20b..814a061 100644 --- a/src/proxy.ts +++ b/src/proxy.ts @@ -6,9 +6,11 @@ import { FileSystemConfig } from './fileSystemConfig'; import * as Logging from './logging'; import { toPromise } from './toPromise'; -async function resolveHostname(hostname: string): Promise { - if (hostname === 'localhost') return ['127.0.0.1']; - return toPromise(cb => dns.resolve(hostname, cb)); +async function resolveHostname(hostname: string): Promise { + return toPromise(cb => dns.lookup(hostname, cb)).then((ip) => { + Logging.debug(`Resolved hostname "${hostname}" to: ${ip}`); + return ip; + }); } function validateConfig(config: FileSystemConfig) { @@ -25,7 +27,7 @@ export async function socks(config: FileSystemConfig): Promise