This document presents the steps to check your network for UDP connectivity to and from the Kobiton server for Lightning mode support.
Prepare the script
- Download and install the latest Node.js LTS version suitable for your OS. If you already have Node.js installed, make sure your Node.js version is 8.0 or newer.
-
Open this link on a web browser, right-click the raw script content, then select Save as…. This will download a script file named index.js on your workstation.
Execute the script
Note: Make sure your workstation is connected to the network you want to check before running the script.
Open a terminal session, then change the working to the download location of the script. The example below assumes the download location is in $HOME/Downloads:
cd $HOME/Downloads
Enter the below command to execute the script:
node index.js
When executed, the script establishes a UDP connection to http://webrtc-check.kobiton.com on port 41234 and perform 2 checks:
- Check 1: Can the client (your workstation) send UDP packets to the Internet to be received by Kobiton UDP server.
- Check 2: Can the client receive UDP packets from the Internet sent by Kobiton UDP server.
If both checks passed and all the other requirements mentioned in the previous section are satisfied, your network supports Lightning mode. Below is the sample output of such a case:
[LOG] The client is launched with below environment variables
- SERVER_URL=http://webrtc-check.kobiton.com
- CLIENT_UDP_PORT=41234
[LOG] Started UDP client at port 41234
[LOG] Retrieving the Kobiton UDP server address
[LOG] Calling to http://webrtc-check.kobiton.com/address
...
[LOG] The Kobiton UDP server is at 11.111.11.11:41234
[LOG] [CHECK 1] Can the client send UDP packets to the Internet ?
[LOG] The client is going to send an UDP packet to Kobiton UDP server at 11.111.11.11:41234
[LOG] Calling to http://webrtc-check.kobiton.com/message?content=1673932442109
...
[LOG] [CHECK 1 - PASSED] The client can send the UDP packet successfully to the Internet since the Kobiton UDP server receives the packet
[LOG] [CHECK 2] Can the client receive UDP packets from the Internet (sent by Kobiton UDP server) ?
[LOG] [CHECK 2 - PASSED] The client receives an UDP packet from Kobiton UDP server.
[LOG]
[LOG] The check process completes. If you encounter any issue, please follow the suggestion, solve it and re-run again to verify it's fixed
If any of the checks fail, the script suggests some actions to fix the issue in the output. Follow the suggested actions, and run the script again to make sure it is fixed. See an example output below for 2 cases:
- Check 1 failed when outgoing traffic on UDP port 41234 is blocked by firewall:
[LOG] [CHECK 1] Can the client send UDP packets to the Internet ?
...
[LOG] [CHECK 1 - FAILED] The client can NOT send the UDP packet to the Internet. Please verify with your IT departmant that: in the office, the outgoing UDP traffic to the Internet with destination port range 30000-65000 is enabled on the router and/or the firewall.
- Check 2 failed when incoming traffic on UDP port 41234 is blocked by firewall:
[LOG] [CHECK 2] Can the client receive UDP packets from the Internet (sent by Kobiton UDP server) ?
[LOG] [CHECK 2 - FAILED] The client can NOT receive the UDP packet from the Internet. Please verify with your IT departmant that:
* In the office, the incoming UDP traffic from the Internet with source port range 30000-65000 is enabled on the router and/or the firewall.
* In the office, the firewall / router enables Symmetric NAT (see https://en.wikipedia.org/wiki/Network_address_translation) so that the Kobiton server is able to send UDP packets to the client which is behind the firewall.
If you run into some errors while running the script, see the next section for troubleshooting.
Troubleshooting script errors
Note: This section only includes the troubleshooting guide for script errors. Issues related to failed checks are not discussed here.
Issue 1: Error ECONNREFUSED when trying to resolve the ip address of the test server.
Sample error output:
[LOG] Calling to http://webrtc-check.kobiton.com/address
[ERROR] Unexpected error when getting server address, please solve and try again connect ECONNREFUSED 11.111.11.11:41234 Error: connect ECONNREFUSED 11.111.11.11:41234
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1300:16) {
errno: -61,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '11.111.11.11',
port: 41234
}
Possible cause: Your workstation cannot establish a connection to http://webrtc-check.kobiton.com. This usually means your network firewall or policy does not allow connection to non-whitelisted domains, or the Kobiton test server is offline.
Solution: Contact your network admins to whitelist http://webrtc-check.kobiton.com. If the error still persists after whitelisting the domain, contact our Support team and provide the error message.
Issue 2: Error ECONNREFUSED when trying to resolve the ip address of the test server.
Sample error output:
[LOG] The client is going to send an UDP packet to Kobiton UDP server at 11.111.11.11:41234
[ERROR] Unexpected error occurs when sending data. Please solve and try again send EPERM 11.111.11.11:41234 Error: send EPERM 11.111.11.11:41234
at doSend (dgram.js:694:16)
at defaultTriggerAsyncIdScope (internal/async_hooks.js:364:12)
at afterDns (dgram.js:640:5)
at processTicksAndRejections (internal/process/task_queues.js:85:21) {
errno: 'EPERM',
code: 'EPERM',
syscall: 'send',
address: '11.111.11.11',
port: 41234
}
Possible cause: The outgoing UDP port 41234 is blocked on your workstation.
Solution: Make sure to allow outgoing connection through this port.