speedtest icon indicating copy to clipboard operation
speedtest copied to clipboard

Make getIP call async

Open mildis opened this issue 6 years ago • 5 comments

Description

Make getIP call async

Why it should be implemented

In standard operation, getIP is the only outgoing connection made by the server.
This call can take a long time or fail.

Optional: implementation suggestions

Also, when call fails (error code != 200), standard message should be displayed instead of the reported error message. (got some raw html for 504 gateway timeout displayed in place of ip infos)

mildis avatar Nov 04 '19 18:11 mildis

I guess you are talking about the node branch, right?

The node version is being completely rewritten currently and uses more async / await than the current one. I will add a better error handling.

dunklesToast avatar Nov 04 '19 18:11 dunklesToast

I think he's talking about the JS, the test doesn't start until we get a response from getIP, and if there's some server side problem it can take a long time.

adolfintel avatar Nov 04 '19 18:11 adolfintel

@adolfintel yes, was talking about the JS.

mildis avatar Nov 04 '19 19:11 mildis

Has there been a solution to this? My speed test server functions fine when using a private IP but experimenting with using public IPs to run a speed test and I get a LONG delay after hitting the "Start" button and then get the HTML code showing up on the screen that is essentially the 504 Gateway Timeout error. I'd like to get this functioning properly but my knowledge of Javascript is a bit limited.

RonRN18 avatar Oct 13 '21 02:10 RonRN18

@RonRN18 You can disable IP/ISP detection if your use case doesn't require it or you can try to investigate the problem.

See here for a list of parameters that can be changed: https://github.com/librespeed/speedtest/wiki/Making-a-custom-front-end

adolfintel avatar Oct 13 '21 07:10 adolfintel