diff --git a/index.js b/index.js index a87bb88..bf56b7c 100644 --- a/index.js +++ b/index.js @@ -11,6 +11,12 @@ let createClient = function(params) { return new MessageBus(connection); }; +/** + * Create a new {@link MessageBus} client on a manually defined bus to connect to + * interfaces or request service names. Connects to the socket specified by the + * properties assigned. + */ +module.exports.createClient = createClient; /** * Create a new {@link MessageBus} client on the DBus system bus to connect to * interfaces or request service names. Connects to the socket specified by the diff --git a/lib/connection.js b/lib/connection.js index c47acdf..a63a7f9 100644 --- a/lib/connection.js +++ b/lib/connection.js @@ -32,7 +32,9 @@ function createStream(opts) { try { switch (family.toLowerCase()) { case 'tcp': - throw new Error('tcp dbus connections are not supported'); + host = params.host || 'localhost'; + port = params.port; + return net.createConnection(port, host); case 'unix': if (params.socket) { return net.createConnection(params.socket);