I have made a simple Video call page, which works using TURN server provided by xirsys for a trial period. I wanted to make my own TURN server on my server. So i used node-turn in my node JS server, like this:

const Turn = require('node-turn');
var turnServer = new Turn({
  // set options
  authMech: 'long-term',
  credentials: {
    myusername: "password@321"
  },
  realm:"domain.com",
  debugLevel:'ALL'
});
turnServer.start();
console.error(turnServer);

when i look at coonsole log it looks like the TURN server is running.

server {
  _eventsCount: 7,
  _maxListeners: undefined,
  software: 'node-turn',
  listeningIps:
   [ '127.0.0.1',
     '::1',
     '172.*.*.126',
     '2400:8904::*:*:fe8d:*',
     '45.*.*.44',
     '172.*.*.200',
     '172.*.*.95',
     '172.*.*.238' ],
  relayIps: [],
  externalIps: null,
  listeningPort: 3478,
  minPort: 49152,
  maxPort: 65535,
  maxAllocateLifetime: 3600,
  defaultAllocatetLifetime: 600,
  authMech: 'long-term',
  realm: 'domain.com',
  staticCredentials: { myusername: 'password@321' },
  log: [Function: bound consoleCall],
  debugLevel: 0,
  allocations: {},
  reservations: {},
  authentification:
   authentification {
     server: [Circular],
     nonces: {},
     credentials: { vikas: 'vikas199915' } },
  network:
   network {
     sockets:
      [ [Socket],
        [Socket],
        [Socket] ],
     server: [Circular],
     listeningIps:
      [ '127.0.0.1',
     '::1',
     '172.*.*.126',
     '2400:8904::*:*:fe8d:*',
     '45.*.*.44',
     '172.*.*.200',
     '172.*.*.95',
     '172.*.*.238' ],
     listeningPort: 3478,
     debug: [Function: bound ],
     debugLevel: 0 },
  allocate: allocate { server: [Circular], lastRelayIp: undefined },
  refresh: refresh { server: [Circular] },
  createPermission: createPermission { server: [Circular] },
  send: send { server: [Circular] },
  channelBind: channelBind { server: [Circular] } }

I have replaced some parts of the IP Addresses with * in the above log. When i try to test the server using Trickle-ICE it gives error like "The server stun:172. * . * .238:3478 returned an error with code=701"

Trying to connect with the server gives 701 error

What am i doing wrong here?

I have tried testing all the IP Address on which the server is listening on, i also tried using my domain name instead of IP Address. It works when i run the same code on local machine and try connecting like this 'turn:localhost:3478' with username and password. But it does not work when i host the code on my cloud server and try connecting on listening IP Addresses.

0

There are 0 best solutions below