Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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()
})
server.listen(10000, function () {
var socket = utp.connect(10000)
socket.write('hello world')
socket.on('data', function (data) {
console.log('echo: ' + data)
})
})