roccomuso/nc

Simple TCP test gives an error (windows)

lichon opened this issue · 1 comments

$ nc localhost 9999
 ......\npm\node_modules\nc\node_modules\netcat\lib\Client.js:39
    if (this._protocol === 'tcp') throw Error('Useless call to init() in TCP mode, use connect() instead')
                                  ^

Error: Useless call to init() in TCP mode, use connect() instead
    at Error (native)
    at Client.init (......\npm\node_modules\nc\node_modules\netcat\lib\Client.js:39:41)
    at Object.<anonymous> (......\npm\node_modules\nc\bin\nc.js:52:12)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:393:7)

There is no protocol attribute in argv at nc.js:51
It should be

  if (_common.protocol === 'tcp') nc3.connect()

Good catch. Fixed in v1.0.1