0

We have a comprehensive web application using Vonage Video API (TokBox) extensively. Task in hand is to monitor and log clients network bandwidth/internet speed, which is a browser application.

After a lot of research I have 2 solutions

  • window.navigator.connection - we support Safari but safari doesn't support this
  • download a image from server and measuring the time taken. It will work with Safari too but will be a overhead, especially when we want to log client internet speed every 2 minutes.

Is there any way to measure internet speed in a web application using low level component, like a network adapter?

ujjwal
  • 428
  • 3
  • 16
  • 2
    A WebSocket is what you probably need, no? – Sergiu Paraschiv May 04 '21 at 11:59
  • @SergiuParaschiv can you please elaborate a bit? Won't opening a websocket to test internet speed will be a overhead? or I am missing out on anything? – ujjwal May 04 '21 at 12:08
  • Well, how can you measure internet speed without transferring data? A WebSocket will have the smallest overhead because it's not dependant on DOM in any way and you can do it in a service worker too. Same for bandwidth, only way to measure that is to keep transferring data in large volume until you hit a limit. – Sergiu Paraschiv May 04 '21 at 12:17
  • 1
    Check this [article](https://stackoverflow.com/questions/5529718/how-to-detect-internet-speed-in-javascript). – Charchit Kapoor May 04 '21 at 12:30

0 Answers0