THRIFT-4489: Add unix domain socket support for nodejs
Client: nodejs

This closes #1491
diff --git a/lib/nodejs/test/client.js b/lib/nodejs/test/client.js
index 006fad2..55839f6 100644
--- a/lib/nodejs/test/client.js
+++ b/lib/nodejs/test/client.js
@@ -36,6 +36,7 @@
   .option('-t, --transport <transport>', 'Set thrift transport (buffered|framed|http) [transport]')
   .option('--port <port>', 'Set thrift server port number to connect', 9090)
   .option('--host <host>', 'Set thrift server host to connect', 'localhost')
+  .option('--domain-socket <path>', 'Set thrift server unix domain socket to connect')
   .option('--ssl', 'use SSL transport')
   .option('--promise', 'test with promise style functions')
   .option('-t, --type <type>', 'Select server type (http|multiplex|tcp|websocket)', 'tcp')
@@ -43,6 +44,7 @@
 
 var host = program.host;
 var port = program.port;
+var domainSocket = program.domainSocket;
 var type = program.type;
 var ssl = program.ssl;
 var promise = program.promise;
@@ -83,11 +85,19 @@
 var testDriver = promise ? ThriftTestDriverPromise : ThriftTestDriver;
 
 if (type === 'tcp' || type === 'multiplex') {
-  connection = ssl ?
-    thrift.createSSLConnection(host, port, options) :
-    thrift.createConnection(host, port, options);
+  if (domainSocket) {
+    connection = thrift.createUDSConnection(domainSocket, options);
+  } else {
+    connection = ssl ?
+      thrift.createSSLConnection(host, port, options) :
+      thrift.createConnection(host, port, options);
+  }
 } else if (type === 'http') {
-  connection = thrift.createHttpConnection(host, port, options);
+  if (domainSocket) {
+    connection = thrift.createHttpUDSConnection(domainSocket, options);
+  } else {
+    connection = thrift.createHttpConnection(host, port, options);
+  }
 } else if (type === 'websocket') {
   connection = thrift.createWSConnection(host, port, options);
   connection.open();