How to use the utp-native.connect function in utp-native

To help you get started, we’ve selected a few utp-native examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github emilbayes / noise-peer / examples / utp.js View on Github external
server.listen(function () {
  var port = server.address().port

  var clientRawStream = utp.connect(port)
  var clientSec = peer(clientRawStream, true)

  clientSec.on('data', function (data) {
    console.log(data.toString())
  })

  clientSec.on('end', function () {
    server.close()
  })

  clientSec.write('Hello world')
  clientSec.end()
})
github gridcontrol / gridcontrol / research / utp.js View on Github external
server.listen(10000, function () {
  var socket = utp.connect(10000)

  socket.write('hello world')
  socket.on('data', function (data) {
    console.log('echo: ' + data)
  })
})

utp-native

Native bindings for libutp

MIT
Latest version published 3 years ago

Package Health Score

54 / 100
Full package analysis

Popular utp-native functions

Similar packages