Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

dns_uv: add localhost hack for windows

  • Loading branch information...
commit 2876141c4292791bc12c0b8701dbcc366dde7297 1 parent 2513538
@ry ry authored
Showing with 9 additions and 0 deletions.
  1. +9 −0 lib/dns_uv.js
View
9 lib/dns_uv.js
@@ -108,6 +108,15 @@ exports.lookup = function(domain, family, callback) {
return {};
}
+ // Hack required for Windows because Win7 removed the
+ // localhost entry from c:\WINDOWS\system32\drivers\etc\hosts
+ // See http://daniel.haxx.se/blog/2011/02/21/localhost-hack-on-windows/
+ // TODO Remove this once c-ares handles this problem.
+ if (process.platform == 'win32' && domain == 'localhost') {
+ callback(null, '127.0.0.1', 4);
+ return {};
+ }
+
var matchedFamily = net.isIP(domain);
if (matchedFamily) {
callback(null, domain, matchedFamily);
Please sign in to comment.
Something went wrong with that request. Please try again.