### Mount Custom SSL Certificates with Docker (Example) Source: https://github.com/openspeedtest/speed-test/blob/main/README.md Example command to run OpenSpeedTest with custom SSL certificates mounted from a specific desktop path. Replace '/Users/vishnu/Desktop/docker/' with your actual certificate directory. ```bash sudo docker run -v /Users/vishnu/Desktop/docker/:/etc/ssl/ --restart=unless-stopped --name openspeedtest -d -p 3000:3000 -p 3001:3001 openspeedtest/latest ``` -------------------------------- ### Setup Free Let's Encrypt SSL with Docker Source: https://github.com/openspeedtest/speed-test/blob/main/README.md Deploy OpenSpeedTest with automatic Let's Encrypt SSL certificate generation and renewal. Requires a domain name pointing to your server's IP and an email address. Sets HTTP to port 80 and HTTPS to port 443. ```bash docker run -e ENABLE_LETSENCRYPT=True -e DOMAIN_NAME=speedtest.yourdomain.com -e USER_EMAIL=you@yourdomain.pro --restart=unless-stopped --name openspeedtest -d -p 80:3000 -p 443:3001 openspeedtest/latest ``` -------------------------------- ### JavaScript API: Initialize and Start OpenSpeedTest Source: https://context7.com/openspeedtest/speed-test/llms.txt Programmatically initialize and start the OpenSpeedTest engine using JavaScript. This code snippet handles the engine startup after the page loads and includes a custom onload handler. ```javascript // The engine is automatically started on page load window.onload = function() { var appSVG = document.getElementById("OpenSpeedTest-UI"); appSVG.parentNode.replaceChild(appSVG.contentDocument.documentElement, appSVG); ostOnload(); OpenSpeedTest.Start(); }; // Custom onload handler function ostOnload() { console.log("OpenSpeedTest.com V2.5.4 Loaded!"); console.log("Now Press the Start Button or HIT Enter."); } ``` -------------------------------- ### GET / (URL Parameters) Source: https://context7.com/openspeedtest/speed-test/llms.txt Control speed test execution and configuration via URL query parameters. ```APIDOC ## GET / ### Description Execute speed tests and configure settings using URL parameters. ### Method GET ### Endpoint /?[parameter] ### Query Parameters - **Run** (integer) - Optional - Start test automatically. If value provided, delay in seconds. - **Stress** (string/integer) - Optional - Run extended test. Accepts presets (Low, Medium, High, VeryHigh, Extreme, Day, Year) or duration in seconds. - **Test** (string) - Optional - Run specific test type: Download, Upload, or Ping. - **Host** (string) - Optional - Override default server with custom host URL. - **XHR** (integer) - Optional - Set parallel connection thread count (1-32). - **Ping** (integer) - Optional - Set number of ping samples. - **Out** (integer) - Optional - Set ping timeout in milliseconds. - **Clean** (integer) - Optional - Set overhead compensation factor (0-4%). ### Request Example http://192.168.1.5?Run=10&Stress=300&Test=Download ``` -------------------------------- ### Custom Server Selection via URL Parameter Source: https://context7.com/openspeedtest/speed-test/llms.txt Specify an alternate test server host by using the `?Host=` or `?H=` parameter. Only valid HTTP/HTTPS URLs are accepted. ```bash # Specify alternate test server http://192.168.1.5?Host=http://192.168.55.1:90 http://192.168.1.5?H=https://yourHost.com ``` ```bash # Only valid HTTP/HTTPS URLs are accepted ``` -------------------------------- ### Select Custom Test Server Source: https://github.com/openspeedtest/speed-test/blob/main/README.md Specify a custom server host for the speed test via URL parameters. ```text http://192.168.1.5?Host=http://192.168.55.1:90 OR http://192.168.1.5?h=http://192.168.55.1:90 ``` -------------------------------- ### Basic Docker Deployment Source: https://context7.com/openspeedtest/speed-test/llms.txt Run OpenSpeedTest in a Docker container, exposing default ports 3000 and 3001. Ensure the container restarts automatically. ```bash sudo docker run --restart=unless-stopped --name openspeedtest -d -p 3000:3000 -p 3001:3001 openspeedtest/latest ``` -------------------------------- ### Configure Multiple Servers for Automatic Selection Source: https://context7.com/openspeedtest/speed-test/llms.txt Define multiple server objects in the `openSpeedTestServerList` array to allow automatic selection based on the lowest latency. Ensure the `Download` and `Upload` paths are correctly specified for each server. ```javascript // In index.html - Add multiple servers for automatic selection var openSpeedTestServerList = [ {"ServerName":"Home-Earth", "Download":"/downloading", "Upload":"/upload", "ServerIcon":"DefaultIcon"}, {"ServerName":"Home-Mars", "Download":"/downloading", "Upload":"/upload", "ServerIcon":"DefaultIcon"}, {"ServerName":"Home-Moon", "Download":"/downloading", "Upload":"/upload", "ServerIcon":"DefaultIcon"} ]; ``` ```javascript // Single server configuration var openSpeedTestServerList = [ {"ServerName":"Home", "Download":"downloading", "Upload":"upload", "ServerIcon":"DefaultIcon"} ]; ``` -------------------------------- ### Docker Deployment with Let's Encrypt SSL Source: https://context7.com/openspeedtest/speed-test/llms.txt Enable automatic SSL certificate generation and renewal with Let's Encrypt by setting environment variables for domain name and email. Ports 80 and 443 are mapped. ```bash docker run -e ENABLE_LETSENCRYPT=True \ -e DOMAIN_NAME=speedtest.yourdomain.com \ -e USER_EMAIL=you@yourdomain.pro \ --restart=unless-stopped \ --name openspeedtest -d \ -p 80:3000 -p 443:3001 \ openspeedtest/latest ``` -------------------------------- ### Define Multiple Speed Test Servers Source: https://github.com/openspeedtest/speed-test/blob/main/README.md Configure a list of servers in Index.html to allow automatic selection based on latency. ```javascript var openSpeedTestServerList = [ {"ServerName":"Home-Earth", "Download":"/downloading", "Upload":"/upload", "ServerIcon":"DefaultIcon"}, {"ServerName":"Home-Mars", "Download":"/downloading", "Upload":"/upload", "ServerIcon":"DefaultIcon"}, {"ServerName":"Home-Moon", "Download":"/downloading", "Upload":"/upload", "ServerIcon":"DefaultIcon"} ]; ``` -------------------------------- ### Configure Stress Test via URL Source: https://github.com/openspeedtest/speed-test/blob/main/README.md Enable continuous speed testing by passing Stress or S parameters with preset keywords or duration in seconds. ```text http://192.168.1.5?Stress=Low ``` ```text http://192.168.1.5?S=L ``` ```text http://192.168.1.5?Stress=5000 ``` -------------------------------- ### Ping Configuration via URL Parameter Source: https://context7.com/openspeedtest/speed-test/llms.txt Configure ping test parameters such as the number of samples (`?Ping=` or `?P=`) for increased accuracy, or the timeout in milliseconds (`?Out=` or `?O=`). ```bash # Set ping sample count (more samples = more accuracy) http://192.168.1.5?Ping=500 http://192.168.1.5?P=500 ``` ```bash # Set ping timeout in milliseconds http://192.168.1.5?Out=7000 http://192.168.1.5?O=7000 ``` -------------------------------- ### Auto-Run Speed Test via URL Parameter Source: https://context7.com/openspeedtest/speed-test/llms.txt Initiate a speed test automatically upon page load by appending `?Run` to the URL. An optional delay in seconds can be specified using `?Run=` or `?R=`. ```bash # Start test immediately http://192.168.1.5?Run ``` ```bash # Start test after 10 seconds delay http://192.168.1.5?Run=10 http://192.168.1.5?R=10 ``` -------------------------------- ### Selective Test Mode via URL Parameter Source: https://context7.com/openspeedtest/speed-test/llms.txt Run specific tests (Download, Upload, or Ping) individually by appending `?Test=` or `?T=` to the URL, where `` can be `D`, `U`, or `P`. ```bash # Download test only http://192.168.1.5?Test=Download http://192.168.1.5?T=D ``` ```bash # Upload test only http://192.168.1.5?Test=Upload http://192.168.1.5?T=U ``` ```bash # Ping test only http://192.168.1.5?Test=Ping http://192.168.1.5?T=P ``` -------------------------------- ### Configure Test Duration and Threading Source: https://context7.com/openspeedtest/speed-test/llms.txt Adjust download and upload test durations, the number of parallel HTTP connections, and data size for uploads. Overhead compensation factors can also be tuned for browser-specific behavior. ```javascript // Test duration in seconds (minimum 12 seconds recommended) var dlDuration = 12; // Download test duration var ulDuration = 12; // Upload test duration ``` ```javascript // Parallel HTTP connections (max 32, default 6) var dlThreads = 6; // Download threads var ulThreads = 6; // Upload threads ``` ```javascript // Upload data size in MB var ulDataSize = 30; ``` ```javascript // Overhead compensation factor (browser-dependent, 4% default) var upAdjust = 1.04; var dlAdjust = 1.04; ``` ```javascript // Ping configuration var pingSamples = 10; // Number of ping samples var pingTimeOut = 5000; // Timeout in milliseconds var pingMethod = "GET"; // HTTP method for ping var jitterFinalSample = 0.5; // 50% of samples for jitter calculation ``` -------------------------------- ### Docker Compose Basic Configuration Source: https://context7.com/openspeedtest/speed-test/llms.txt Deploy OpenSpeedTest using Docker Compose for simplified management. This configuration uses the default ports. ```yaml version: '3.3' services: speedtest: restart: unless-stopped container_name: openspeedtest ports: - '3000:3000' - '3001:3001' image: openspeedtest/latest ``` -------------------------------- ### Docker Compose with Let's Encrypt SSL Source: https://context7.com/openspeedtest/speed-test/llms.txt Configure Docker Compose for OpenSpeedTest with Let's Encrypt integration. Set environment variables for domain and email to enable automatic SSL. ```yaml version: '3.3' services: speedtest: environment: - ENABLE_LETSENCRYPT=True - DOMAIN_NAME=speedtest.yourdomain.com - USER_EMAIL=you@yourdomain.pro restart: unless-stopped container_name: openspeedtest ports: - '80:3000' - '443:3001' image: openspeedtest/latest ``` -------------------------------- ### Advanced Docker Configuration with Environment Variables Source: https://context7.com/openspeedtest/speed-test/llms.txt Customize OpenSpeedTest container behavior using environment variables for ports, user ID, allowed domains (CORS), and server name. ```bash # Environment variables for advanced configuration docker run -e CHANGE_CONTAINER_PORTS=True \ -e HTTP_PORT=3000 \ -e HTTPS_PORT=3001 \ -e SET_USER=101 \ -e ALLOW_ONLY="domain1.com;domain2.com;domain3.com" \ -e SET_SERVER_NAME="HOME-NAS" \ --restart=unless-stopped \ --name openspeedtest -d \ -p 3000:3000 -p 3001:3001 \ openspeedtest/latest ``` -------------------------------- ### Docker Deployment with Custom SSL Certificates Source: https://context7.com/openspeedtest/speed-test/llms.txt Deploy OpenSpeedTest using a custom SSL certificate by mounting your certificate files (nginx.crt and nginx.key) to the container's /etc/ssl/ directory. ```bash sudo docker run -v /path/to/your/ssl/certs/:/etc/ssl/ \ --restart=unless-stopped \ --name openspeedtest -d \ -p 3000:3000 -p 3001:3001 \ openspeedtest/latest ``` -------------------------------- ### Mount Custom SSL Certificates with Docker Source: https://github.com/openspeedtest/speed-test/blob/main/README.md Run OpenSpeedTest and mount a local directory containing your custom SSL certificate (nginx.crt) and key (nginx.key) into the container's /etc/ssl/ directory. This allows using self-signed or paid SSL certificates. ```bash sudo docker run -v /${PATH-TO-YOUR-OWN-SSL-CERTIFICATE}:/etc/ssl/ --restart=unless-stopped --name openspeedtest -d -p 3000:3000 -p 3001:3001 openspeedtest/latest ``` -------------------------------- ### HTTP Connection Threads via URL Parameter Source: https://context7.com/openspeedtest/speed-test/llms.txt Adjust the number of parallel HTTP connections for bandwidth testing using the `?XHR=` or `?X=` parameter, with a valid range of 1-32. ```bash # Set custom thread count (1-32) http://192.168.1.5?XHR=3 http://192.168.1.5?X=3 ``` -------------------------------- ### Overhead Compensation via URL Parameter Source: https://context7.com/openspeedtest/speed-test/llms.txt Disable overhead compensation entirely by using `?Clean` or `?C`, or set a custom compensation factor between 1-4% using `?Clean=` or `?C=`. ```bash # Disable overhead compensation (set to 0%) http://192.168.1.5?Clean http://192.168.1.5?C ``` ```bash # Set custom compensation (1-4%) http://192.168.1.5?Clean=2 http://192.168.1.5?C=2 ``` -------------------------------- ### Docker Deployment with Custom Ports Source: https://context7.com/openspeedtest/speed-test/llms.txt Deploy OpenSpeedTest using Docker, mapping custom host ports (e.g., 80 for HTTP, 443 for HTTPS) to the container's default ports. ```bash sudo docker run --restart=unless-stopped --name openspeedtest -d -p 80:3000 -p 443:3001 openspeedtest/latest ``` -------------------------------- ### Stress Test Mode via URL Parameter Source: https://context7.com/openspeedtest/speed-test/llms.txt Activate stress test mode for network stability testing using predefined durations (e.g., `?Stress=Low`) or custom durations in seconds (e.g., `?Stress=5000`). Can be combined with auto-run. ```bash # Preset durations: Low=300s, Medium=600s, High=900s, VeryHigh=1800s, Extreme=3600s, Day=86400s, Year=31557600s http://192.168.1.5?Stress=Low http://192.168.1.5?S=L ``` ```bash # Custom duration in seconds http://192.168.1.5?Stress=5000 http://192.168.1.5?S=5000 ``` ```bash # Combine with auto-run (runs 300 seconds each direction) http://192.168.1.5?Run&Stress=300 http://192.168.1.5?R&S=300 ``` -------------------------------- ### Nginx Configuration for OpenSpeedTest Source: https://context7.com/openspeedtest/speed-test/llms.txt Essential Nginx server block configuration for OpenSpeedTest, including required methods, client body size, timeouts, and disabling access logs for performance. ```nginx # Essential server requirements: # - Accept GET, POST, HEAD & OPTIONS methods with 200 OK response # - Accept POST to static files with 200 OK response # - client_max_body_size >= 35 Megabytes # - Timeout > 60 seconds # - Disable access logs for performance # - HTTP/1.1 recommended for maximum performance (HTTP/2 and HTTP/3 supported) server { listen 80; server_name speedtest.example.com; client_max_body_size 35M; # Disable access logs for performance access_log off; location / { root /var/www/openspeedtest; index index.html; } # Handle POST to static files location ~ ^/(downloading|upload)$ { root /var/www/openspeedtest; # Allow POST method if ($request_method = POST) { return 200; } } } ``` -------------------------------- ### Configure Container Ports Source: https://github.com/openspeedtest/speed-test/blob/main/README.md Set `CHANGE_CONTAINER_PORTS` to "True" and specify `HTTP_PORT` and `HTTPS_PORT` to change the default ports. This is useful for avoiding port conflicts or customizing network access. ```bash CHANGE_CONTAINER_PORTS=True HTTP_PORT=3000 HTTPS_PORT=3001 ``` -------------------------------- ### Configure Ping Timeout Source: https://github.com/openspeedtest/speed-test/blob/main/README.md Set the server response timeout in milliseconds for ping requests. ```text http://192.168.1.5?Out=7000 OR http://192.168.1.5?O=7000 ``` -------------------------------- ### Configure Database Result Saving Source: https://github.com/openspeedtest/speed-test/blob/main/README.md Enable and set the endpoint for saving test results by editing Index.html. ```javascript var saveData = true; var saveDataURL = "//yourDatabase.Server.com:4500/save?data="; ``` -------------------------------- ### JavaScript API: Feature Toggle Configuration Source: https://context7.com/openspeedtest/speed-test/llms.txt Configure feature toggles for OpenSpeedTest using JavaScript variables in index.html. This allows enabling or disabling URL parameter functionalities. ```javascript // Enable/disable URL parameter features in index.html var setPingSamples = true; // Allow ?Ping=N parameter var setPingTimeout = true; // Allow ?Out=N parameter var setHTTPReq = true; // Allow ?XHR=N parameter var stressTest = true; // Allow ?Stress=N parameter var selectTest = true; // Allow ?Test=X parameter var selectServer = true; // Allow ?Host=URL parameter var enableRun = true; // Allow ?Run parameter var enableClean = true; // Allow ?Clean parameter ``` -------------------------------- ### Enable Database Integration for Test Results Source: https://context7.com/openspeedtest/speed-test/llms.txt Set `saveData` to `true` and provide a `saveDataURL` to enable saving test results to a remote database endpoint. Results are sent as URL parameters. ```javascript // Enable result saving var saveData = true; var saveDataURL = "//yourDatabase.Server.com:4500/save?data="; // Results are sent as URL parameters: // d=&u=&p=&j=&dd=&ud=&ua= ``` -------------------------------- ### Set Server Name for UI Display Source: https://github.com/openspeedtest/speed-test/blob/main/README.md Use `SET_SERVER_NAME` to define a custom name that will be displayed on the OpenSpeedTest user interface. This helps in identifying different server instances. ```bash SET_SERVER_NAME=HOME-NAS ``` -------------------------------- ### Set Ping Sample Size Source: https://github.com/openspeedtest/speed-test/blob/main/README.md Define the number of ping requests sent to calculate the average latency. ```text http://192.168.1.5?Ping=500 OR http://192.168.1.5?P=500 ``` -------------------------------- ### Docker Compose with Custom SSL Certificates Source: https://context7.com/openspeedtest/speed-test/llms.txt Configure Docker Compose to use custom SSL certificates by mounting a volume containing your certificate files to the container's /etc/ssl/ directory. ```yaml version: '3.3' services: speedtest: volumes: - '/path/to/your/ssl/certs/:/etc/ssl/' restart: unless-stopped container_name: openspeedtest ports: - '3000:3000' - '3001:3001' image: openspeedtest/latest ``` -------------------------------- ### Set Server User ID Source: https://github.com/openspeedtest/speed-test/blob/main/README.md Use the `SET_USER` environment variable to assign a specific User ID to the server process. This can be relevant for file permissions or process management within the container. ```bash SET_USER=101 ``` -------------------------------- ### Automate Speed Test Execution Source: https://github.com/openspeedtest/speed-test/blob/main/README.md Trigger a speed test automatically on page load or after a specified delay. ```text http://192.168.1.5?Run ``` ```text http://192.168.1.5?Run=10 or http://192.168.1.5?R=10 ``` ```text http://192.168.1.5?Run&Stress=300 OR http://192.168.1.5?R&S=300 ``` -------------------------------- ### Allow Only Specific CORS Domains Source: https://github.com/openspeedtest/speed-test/blob/main/README.md Configure `ALLOW_ONLY` with a semicolon-separated list of domains to restrict Cross-Origin Resource Sharing requests. This enhances security by only permitting requests from trusted sources. ```bash ALLOW_ONLY=domain1.com;domain2.com;domain3.com ``` -------------------------------- ### Docker Compose for Custom SSL Certificates Source: https://github.com/openspeedtest/speed-test/blob/main/README.md Docker Compose configuration to mount a local directory containing custom SSL certificates (nginx.crt and nginx.key) into the container. The volume mapping directs your local SSL certificate folder to /etc/ssl/ within the container. ```yaml version: '3.3' services: speedtest: volumes: - '/Users/vishnu/Desktop/docker/:/etc/ssl/' restart: unless-stopped container_name: openspeedtest ports: - '3000:3000' - '3001:3001' image: openspeedtest/latest ``` -------------------------------- ### Adjust Overhead Compensation Source: https://github.com/openspeedtest/speed-test/blob/main/README.md Reset or modify the browser-based overhead compensation factor using URL parameters. ```text http://192.168.1.5?clean ``` -------------------------------- ### Modify Parallel HTTP Connections Source: https://github.com/openspeedtest/speed-test/blob/main/README.md Change the default limit of 6 parallel HTTP connections using the XHR parameter. ```text http://192.168.1.5?XHR=3 OR http://192.168.1.5?X=3 ``` -------------------------------- ### Restrict Test Type Source: https://github.com/openspeedtest/speed-test/blob/main/README.md Limit the speed test to a specific operation like Download, Upload, or Ping. ```text http://192.168.1.5?Test=Upload OR http://192.168.1.5?T=U ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.