diff --git a/UdpSockets.js b/UdpSockets.js index e2e3cb6..5335f1c 100644 --- a/UdpSockets.js +++ b/UdpSockets.js @@ -6,10 +6,9 @@ var UdpSocket = require('./UdpSocket'); -exports.createSocket = function(type) { - return new UdpSocket({ - type: type - }) +exports.createSocket = function(options) { + if (typeof options === 'string') options = { type: options } + return new UdpSocket(options) } exports.Socket = UdpSocket;