-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Self-host on docker #13
Comments
@jerrywoo96 thanks for reaching out. This module is only the client side where the measurements are initiated from (expected to run in a modern browser environment). By default it targets endpoints on the Cloudflare edge, but you can configure it to send requests against a different target, as long as they behave the same. Please see the |
So, if this project contains only the files required to run on the browser side, May i know where can i get the server side files or project to self-host and run the endpoint server? |
We use Cloudflare workers to host the target endpoints for download and upload requests. You can find in this other repo a template of the workers code that includes the required endpoints. |
Will there be an opportunity for the team to create an all-in-one docker image that host the browser side files and the endpoint server? Such that it is deployment friendly in homelab environments. Apologies, I'm not well-versed with Cloudflare workers 😅. For example, https://hub.docker.com/r/openspeedtest/latest Note: I've tried those 2, and am looking for other alternatives with enhancements, thus stumbled onto this project. |
Whether or not Cloudflare provides such a self-hosted option in the future, you could most likely build one on your own combining the template @vasturiano mentioned with https://github.com/cloudflare/workerd. The |
Posting this here on the topic of self-hosted speedtest tools: It was pretty straightforward to get the Cloudflare worker setup using the provided template. Purchased a domain and got routes setup to avoid any CORS issues. My setup:
My configuration:
However, there is still a sizable difference in download speeds on Safari based browsers when I test. I believe I still get the estimated results per #18 so maybe I am missing something. Is the default configuration used on speed.cloudflare.com the same as in the readme? @carlosefr Edit:
Would I want |
Is the client application running from the same domain as the up/down endpoints? Safari may send cross-domain requests through Private Relay when the "hide IP address from trackers" setting is enabled (which is the default). |
Thank you @carlosefr. The client application is on the same domain as the up/down endpoints. The client is hosted on Vercel, so I have an A record with that IP address and Proxy Status enabled. I set up Worker routes to handle the up/down endpoints: I do see that my site has 1 tracker Thank you for your time. |
I've tried your version in Chrome, Firefox, and Safari. The first two give identical results, but all of them show values significantly below those of speed.cloudflare.com (where I get identical values for all browsers, all matching my connection's specs). There are a few things to take into consideration here... When using this speedtest client against the default endpoints and using the default test configuration, the results should be the same as those reported by https://speed.cloudflare.com itself. If they aren't it might be a bug. The exception is Safari. Safari, by default, sends some cross-domain requests through Apple Private Relay and that will affect results. To confirm this:
When using this speedtest client against custom endpoints (regardless of the test configuration), results may be impacted by many factors, including:
If you're self-hosting the reference worker implementation under If you're hosting the reference worker implementation in your own Cloudflare account, you should consider that the type of account will also affect where it's served from. |
If you're looking for something self-hosted, shameless plug to check out https://github.com/alexjustesen/speedtest-tracker. I've got integrating Cloudflare Speedtest on the to-do list. |
I've came across b4, but this topic is about measuring speed between self-hosted server and client devices. If i'm not wrong, the project u linked to is measuring speed between self-hosted server to ookla servers yup? |
Thank you. I think I will go back to using the default endpoints and put a "warning" on the website that Safari users may not have accurate readings. This is my first time using Cloudflare workers - are usage limits pretty easy to setup for something like this? I was nervous that with a pay-as-you-go plan we might run into trouble. Our site will primarily be used for informational purposes anyway. Originally we wanted to build something similar to https://business.utah.gov/broadband/speed-test/. |
At the moment that's correct, however I'll be adding support for iPerf and Cloudflare's Speedtest later this summer. |
i'm looking forward to it. if it is as detailed as the one cloudflare is serving and as beautiful as yours, i'll be happy to self-host your image :) |
Will there be a possibility of publishing an official docker image to self-host on our docker machines to check network speed to the docker machine from other devices?
The text was updated successfully, but these errors were encountered: