e7d / speedtest

A self-hosted, lightweight HTML5 speed test implemented in JavaScript, based on Web Workers and XMLHttpRequest.

Home Page:https://hub.docker.com/r/e7db/speedtest

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot set any parameters in config.json

Shadebzh opened this issue · comments

commented

Dear Sir,

Thank you for this great software ! Very useful... I try to change some options, but it seem my config.json is never read, when I launch npm run start:dev, I've got my good config.json in "dist" directory, but the option don't seem to be used
Any help ? Thank you a lot !

Here is an example for my config.json file :

{
"download": {
"duration": 30
}
}

Hello @Shadebzh,

You are right. I just figured the documentation is way out of date with latest set of configurable options.
I'll try to address that as soon as possible.

commented

Thank you a lot ! Just to know, is there a way to find new parameters in a source code file ?

You can find all configurable options in this file:
https://github.com/e7d/speedtest/blob/master/packages/web/src/js/worker/config.js
Be aware that the final configuration is mage by combining the result of the different methods. You would need to be able to understand a bit of JavaScript.
I also reckon that there is a problem with the current state of the configuration handling.

Despite being able to configure a lot of download/upload options, some of them are overridden by the front end, through the presets. You can find them by clicking the cog on the top right corner.
As long as you don't change the preset you are fine. But as soon as you set one, even the "normal" one, a combination of parameters are overridden, including the download duration you are interested on. That's probably why you would not see your change on config.json being reflected.

That is definitely an issue i would need to address.

commented

Thank you again a lot for your answer.

In fact, I try to make (force) download and upload request via websocket rather than XHR (due to XHR number concurrent limit in browser).

I have noticed the parameter endpoint.websocket with ws://, get parameters in config.js and also noticed you make a GET request on config.json in xhr, but when I try to make this :
{
"endpoints": [
{
"label": "Websocket1",
"uri": "ws://185.176.168.169:5080"
}
]
}

No websocket, only XHR. Is there any wat to do this ? Last question I promise ;-) Thank you.

Hi again @Shadebzh

The endpoints key only goal is to setup the list of external endpoints usable from a defined speedtest instance.
In this section, you would only reference other speedtest websites, through their respective HTTP-based URIs.

What you seem to want to achieve is to switch from XHR-based bandwidth tests to WebSocket-based ones.
It was possible in past versions, but not anymore. It was kind of working, but the behavior was really inconsistent from an environment to another. Long story short, Chrome was kind of OK on any OS, other browsers/OS combinations lead regularly to strange or unpredictable behaviors.

My project having in mind to be as much all-terrain as possible, i decided to lock out this option, as long as I can't find a satisfying enough solution.

Regards.