node:dgram:633
port = validatePort(port, 'Port', false);
^
RangeError [ERR_SOCKET_BAD_PORT]: Port should be > 0 and < 65536. Received type number (0).
at Socket.send (node:dgram:633:12)
at UdpWrapper.send (/code/node_modules/stun-js/lib/transports/udp.js:64:16)
at StunComm.sendStunRequest (/code/node_modules/stun-js/lib/stun_comm.js:101:19)
at StunComm.sendStunRequestP (/code/node_modules/stun-js/lib/stun_comm.js:139:8)
at TurnClient.sendAllocateP (/code/node_modules/turn-js/lib/turn_client.js:355:15)
at TurnClient.allocateP (/code/node_modules/turn-js/lib/turn_client.js:58:15)
at TurnClient.allocate (/code/node_modules/turn-js/lib/turn_client.js:134:8)
at <anonymous> (/code/example.ts:16:8)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
code: 'ERR_SOCKET_BAD_PORT'
}
Node.js v22.9.0
/code/node_modules/stun-js/lib/transports/tcp.js:88
var flushed = this._client.write(bytes, 'binary', function () {
^
TypeError: Cannot read properties of undefined (reading 'write')
at TcpWrapper.send (/code/node_modules/stun-js/lib/transports/tcp.js:88:30)
at StunComm.sendStunRequest (/code/node_modules/stun-js/lib/stun_comm.js:101:19)
at StunComm.sendStunRequestP (/code/node_modules/stun-js/lib/stun_comm.js:139:8)
at TurnClient.sendAllocateP (/code/node_modules/turn-js/lib/turn_client.js:355:15)
at TurnClient.allocateP (/code/node_modules/turn-js/lib/turn_client.js:58:15)
at TurnClient.allocate (/code/node_modules/turn-js/lib/turn_client.js:134:8)
at <anonymous> (/code/example.ts:16:8)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
Node.js v22.9.0
Hi, I'm trying to use this lib to access the Cloudflare TURN Service but hitting errors for both
TCP
andUDP
:Is it possible that it's not compatible with recent node versions?
UDP
TCP