rafatjah commited on
Commit
e76a1eb
·
1 Parent(s): 3de3438

Original dockerfile With wget V2

Browse files
Files changed (43) hide show
  1. Dockerfile +76 -2
  2. files/OpenSpeedTest-Server.conf +106 -0
  3. files/entrypoint.sh +152 -0
  4. files/nginx.conf +19 -0
  5. files/nginx.crt +24 -0
  6. files/nginx.key +27 -0
  7. files/renew.sh +20 -0
  8. files/www/.gitignore +1 -0
  9. files/www/License.md +21 -0
  10. files/www/README.md +421 -0
  11. files/www/assets/css/app.css +382 -0
  12. files/www/assets/css/darkmode.css +45 -0
  13. files/www/assets/fonts/roboto-v30-latin-500.eot +0 -0
  14. files/www/assets/fonts/roboto-v30-latin-500.svg +305 -0
  15. files/www/assets/fonts/roboto-v30-latin-500.ttf +0 -0
  16. files/www/assets/fonts/roboto-v30-latin-500.woff +0 -0
  17. files/www/assets/fonts/roboto-v30-latin-500.woff2 +0 -0
  18. files/www/assets/fonts/roboto-v30-latin-regular.eot +0 -0
  19. files/www/assets/fonts/roboto-v30-latin-regular.svg +308 -0
  20. files/www/assets/fonts/roboto-v30-latin-regular.ttf +0 -0
  21. files/www/assets/fonts/roboto-v30-latin-regular.woff +0 -0
  22. files/www/assets/fonts/roboto-v30-latin-regular.woff2 +0 -0
  23. files/www/assets/images/app.svg +459 -0
  24. files/www/assets/images/icons/android-chrome-192x192.png +0 -0
  25. files/www/assets/images/icons/android-chrome-512x512.png +0 -0
  26. files/www/assets/images/icons/apple-touch-icon.png +0 -0
  27. files/www/assets/images/icons/browserconfig.xml +9 -0
  28. files/www/assets/images/icons/favicon-16x16.png +0 -0
  29. files/www/assets/images/icons/favicon-32x32.png +0 -0
  30. files/www/assets/images/icons/favicon.ico +0 -0
  31. files/www/assets/images/icons/launcher-icon-1x.png +0 -0
  32. files/www/assets/images/icons/launcher-icon-2x.png +0 -0
  33. files/www/assets/images/icons/launcher-icon-3x.png +0 -0
  34. files/www/assets/images/icons/launcher-icon-4x.png +0 -0
  35. files/www/assets/images/icons/mstile-150x150.png +0 -0
  36. files/www/assets/images/icons/safari-pinned-tab.svg +108 -0
  37. files/www/assets/images/icons/site.webmanifest +22 -0
  38. files/www/assets/js/app-2.5.4.js +1427 -0
  39. files/www/assets/js/app-2.5.4.min.js +51 -0
  40. files/www/assets/js/darkmode.js +6 -0
  41. files/www/hosted.html +25 -0
  42. files/www/index.html +167 -0
  43. files/www/upload +0 -0
Dockerfile CHANGED
@@ -1,4 +1,78 @@
1
- FROM openspeedtest/latest
 
 
2
 
 
3
 
4
- CMD ["/entrypoint.sh"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # By OpenSpeedTest
2
+ # Dockerfile for https://hub.docker.com/r/openspeedtest/latest
3
+ FROM nginxinc/nginx-unprivileged:stable-alpine
4
 
5
+ LABEL maintainer "OpenSpeedTest.com <support@OpenSpeedTest.com>"
6
 
7
+ ENV ENABLE_LETSENCRYPT=false
8
+ ENV DOMAIN_NAME=false
9
+ ENV USER_EMAIL=false
10
+ ENV CONFIG=/etc/nginx/conf.d/OpenSpeedTest-Server.conf
11
+ ENV INDEX_HTML=/usr/share/nginx/html/index.html
12
+
13
+ ENV CHANGE_CONTAINER_PORTS=false
14
+ ENV HTTP_PORT=3000
15
+ ENV HTTPS_PORT=3001
16
+ ENV SET_USER=101
17
+
18
+ COPY /files/OpenSpeedTest-Server.conf ${CONFIG}
19
+ COPY /files/entrypoint.sh /entrypoint.sh
20
+ COPY /files/renew.sh /renew.sh
21
+ RUN rm /etc/nginx/nginx.conf
22
+ COPY /files/nginx.conf /etc/nginx/
23
+ COPY /files/www/ /usr/share/nginx/html/
24
+ RUN wget https://github.com/openspeedtest/Docker-Image/raw/main/files/www/downloading -O /usr/share/nginx/html/downloading
25
+ COPY /files/nginx.crt /etc/ssl/
26
+ COPY /files/nginx.key /etc/ssl/
27
+
28
+
29
+
30
+ USER root
31
+ VOLUME /var/log/letsencrypt
32
+ RUN rm -rf /etc/nginx/conf.d/default.conf \
33
+ && chown -R nginx /usr/share/nginx/html/ \
34
+ && chmod 755 /usr/share/nginx/html/downloading \
35
+ && chmod 755 /usr/share/nginx/html/upload \
36
+ && chown nginx ${CONFIG} \
37
+ && chmod 400 ${CONFIG} \
38
+ && chown nginx /etc/nginx/nginx.conf \
39
+ && chmod 400 /etc/nginx/nginx.conf \
40
+ && chmod +x /entrypoint.sh \
41
+ && chmod +x /renew.sh
42
+
43
+
44
+
45
+ RUN mkdir -p /etc/letsencrypt && \
46
+ chown -R nginx /etc/letsencrypt && \
47
+ chmod 775 /etc/letsencrypt
48
+
49
+ RUN mkdir -p /var/lib/letsencrypt && \
50
+ chown -R nginx /var/lib/letsencrypt && \
51
+ chmod 775 /var/lib/letsencrypt
52
+
53
+ RUN mkdir -p /var/log/letsencrypt && \
54
+ chown -R nginx /var/log/letsencrypt && \
55
+ chmod 775 /var/log/letsencrypt
56
+
57
+ RUN mkdir -p /usr/share/nginx/html/.well-known/acme-challenge && \
58
+ chown -R nginx /usr/share/nginx/html/.well-known/acme-challenge && \
59
+ chmod 775 /usr/share/nginx/html/.well-known/acme-challenge
60
+
61
+ RUN apk update && apk add ca-certificates && rm -rf /var/cache/apk/*
62
+ RUN update-ca-certificates
63
+ RUN apk add --no-cache certbot certbot-nginx
64
+ RUN apk update && apk add --no-cache dcron libcap
65
+
66
+ RUN chown nginx:nginx /usr/sbin/crond \
67
+ && setcap cap_setgid=ep /usr/sbin/crond
68
+
69
+ RUN touch /etc/crontabs/nginx
70
+ RUN chown -R nginx:nginx /etc/crontabs/nginx
71
+
72
+ USER ${SET_USER}
73
+
74
+ EXPOSE ${HTTP_PORT} ${HTTPS_PORT}
75
+
76
+ STOPSIGNAL SIGQUIT
77
+
78
+ CMD ["/entrypoint.sh"]
files/OpenSpeedTest-Server.conf ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SpeedTest by OpenSpeedTest™ is a Free and Open-Source Network Speed Test Software.
2
+ # Like this Project? Please Donate NOW & Keep us Alive -> https://go.openspeedtest.com/Donate
3
+ # Thank you for your support! we greatly appreciate your donation.
4
+ # Your contribution helps us continue to improve and maintain the tool for everyone to use.
5
+ # Official Website : https://OpenSpeedTest.com | Email: support@openspeedtest.com
6
+ # Developed by : Vishnu | https://Vishnu.Pro | Email : me@vishnu.pro
7
+
8
+ server {
9
+ server_name _ localhost YOURDOMAIN;
10
+ listen 3000 reuseport;
11
+ listen 3001 ssl reuseport;
12
+ listen [::]:3000 reuseport;
13
+ listen [::]:3001 ssl reuseport;
14
+ # If you like to Enable HTTP2 add "http2" to the above line.
15
+ # If HTTP2 Enabled. Upload location should Proxy_Pass to http 1.1 port.
16
+ # Otherwise you will see abnormal Upload Speeds.
17
+ # Nginx Server Windows SSL Performance was very poor! Better use Linux if you need SSL support.
18
+ ssl_certificate /etc/ssl/nginx.crt; # Use your own certificate & key
19
+ ssl_certificate_key /etc/ssl/nginx.key; # <-- key
20
+ ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
21
+ ssl_ciphers "ALL";
22
+ ssl_prefer_server_ciphers on;
23
+ ssl_session_cache shared:SSL:100m;
24
+ ssl_session_timeout 1d;
25
+ ssl_session_tickets on;
26
+ root /usr/share/nginx/html/;
27
+ index index.html;
28
+ client_max_body_size 35m;
29
+ error_page 405 =200 $uri;
30
+ access_log off;
31
+ gzip off;
32
+ fastcgi_read_timeout 999;
33
+ log_not_found off;
34
+ server_tokens off;
35
+ error_log /dev/null; #Disable this for Windows Nginx.
36
+ tcp_nodelay on;
37
+ tcp_nopush on;
38
+ sendfile on;
39
+ open_file_cache max=200000 inactive=20s;
40
+ open_file_cache_valid 30s;
41
+ open_file_cache_min_uses 2;
42
+ open_file_cache_errors off;
43
+
44
+ location ~ /\.well-known/acme-challenge/ {
45
+ allow all;
46
+ default_type "text/plain";
47
+ root /usr/share/nginx/html/;
48
+ try_files $uri =404;
49
+ break;
50
+ }
51
+
52
+ location / {
53
+ add_header 'Access-Control-Allow-Origin' "*" always;
54
+ add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Mx-ReqToken,X-Requested-With' always;
55
+ add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
56
+ #Very Very Important! You SHOULD send no-store from server for Google Chrome.
57
+ add_header Cache-Control 'no-store, no-cache, max-age=0, no-transform';
58
+ add_header Last-Modified $date_gmt;
59
+ if_modified_since off;
60
+ expires off;
61
+ etag off;
62
+
63
+ if ($request_method = OPTIONS ) {
64
+ add_header 'Access-Control-Allow-Credentials' "true";
65
+ add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Mx-ReqToken,X-Requested-With' always;
66
+ add_header 'Access-Control-Allow-Origin' "$http_origin" always;
67
+ add_header 'Access-Control-Allow-Methods' "GET, POST, OPTIONS" always;
68
+ return 200;
69
+ }
70
+ }
71
+
72
+ #HTTP2 & HTTP3 will not wait for the post body and return 200. We need to stop that behaviour.
73
+ #Otherwise, you will see abnormal upload speed. To fix this issue, Enable the following lines. (Only Applicable If you Enabled HTTP2 or HTTP3 in This Server.)
74
+
75
+ #HTTP2 & HTTP3 -> UPLOAD FIX -- START
76
+
77
+ #location = /upload {
78
+ # proxy_pass http://127.0.0.1:3000/dev-null;
79
+ #}
80
+ #location = /dev-null {
81
+ # return 200;
82
+ #}
83
+
84
+ #HTTP2 & HTTP3 -> UPLOAD FIX -- END
85
+
86
+ # Caching for Static Files,
87
+ location ~* ^.+\.(?:css|cur|js|jpe?g|gif|htc|ico|png|html|xml|otf|ttf|eot|woff|woff2|svg)$ {
88
+ access_log off;
89
+ expires 365d;
90
+ add_header Cache-Control public;
91
+ add_header Vary Accept-Encoding;
92
+ tcp_nodelay off;
93
+ open_file_cache max=3000 inactive=120s;
94
+ open_file_cache_valid 45s;
95
+ open_file_cache_min_uses 2;
96
+ open_file_cache_errors off;
97
+ gzip on;
98
+ gzip_disable "msie6";
99
+ gzip_vary on;
100
+ gzip_proxied any;
101
+ gzip_comp_level 6;
102
+ gzip_buffers 16 8k;
103
+ gzip_http_version 1.1;
104
+ gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript image/svg+xml;
105
+ }
106
+ }
files/entrypoint.sh ADDED
@@ -0,0 +1,152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/sh
2
+
3
+ ip a | egrep -q 'inet6 '
4
+ if [[ $? -ne 0 ]]; then
5
+ # IPv6 not enabled
6
+ sed -i '/listen \[::\]:300/d' ${CONFIG}
7
+ fi
8
+
9
+ ip a | egrep -q 'inet '
10
+ if [[ $? -ne 0 ]]; then
11
+ # IPv4 not enabled
12
+ sed -i '/listen 300/d' ${CONFIG}
13
+ fi
14
+
15
+
16
+ if [ "$CHANGE_CONTAINER_PORTS" = True ]; then
17
+ if [ "$HTTP_PORT" ]; then
18
+ sed -i "s/3000/${HTTP_PORT}/g" ${CONFIG}
19
+ if [ $? -eq 0 ]; then
20
+ echo "Changed HTTP container port to " ${HTTP_PORT}
21
+ else
22
+ echo "Failed to change HTTP container port to " ${HTTP_PORT}
23
+ fi
24
+
25
+ fi
26
+
27
+ if [ "$HTTPS_PORT" ]; then
28
+ sed -i "s/3001/${HTTPS_PORT}/g" ${CONFIG}
29
+ if [ $? -eq 0 ]; then
30
+ echo "Changed HTTPS container port to " ${HTTPS_PORT}
31
+ else
32
+ echo "Failed to change HTTPS container port to " ${HTTPS_PORT}
33
+ fi
34
+
35
+ fi
36
+ fi
37
+
38
+
39
+ Verify_TXT_path="/usr/share/nginx/html/Verify.txt"
40
+
41
+ if [ "$VERIFY_OWNERSHIP" ]; then
42
+ if [ -f "$Verify_TXT_path" ]; then
43
+ echo "Verify.txt Found!"
44
+ else
45
+ echo ${VERIFY_OWNERSHIP} > /usr/share/nginx/html/Verify.txt
46
+ echo "Verify.txt Created!"
47
+ fi
48
+ fi
49
+
50
+ if [ "$SET_SERVER_NAME" ]; then
51
+ SERVER_NAME='<h1 style="display: inline;color: #7c888d; font-size: 22px;font-family: Roboto-Medium, Roboto;font-weight: 500;">'${SET_SERVER_NAME}'</h1>'
52
+ if ! grep -q "$SERVER_NAME" "$INDEX_HTML"; then
53
+ sed -i -e '/<body>/a\'$'\n'"$SERVER_NAME" ${INDEX_HTML}
54
+ fi
55
+ fi
56
+
57
+ if [ "$ALLOW_ONLY" ]; then
58
+
59
+ allow_only=${ALLOW_ONLY}
60
+
61
+ IFS=';' domains=$(echo "$allow_only" | tr ';' '\n')
62
+
63
+ map_config="map \$http_origin \$allowed_origin {
64
+ default 0;
65
+ "
66
+ while IFS= read -r line; do
67
+ escaped_domain=$(echo "$line" | sed 's/\./\\./g')
68
+ map_config="$map_config \"~^https?://(www\.)?($escaped_domain)\$\" 1;
69
+ "
70
+ done < <(printf '%s\n' "$domains")
71
+
72
+ map_config="$map_config}"
73
+
74
+ nginx_conf_path="/etc/nginx/nginx.conf"
75
+ pattern="map \$http_origin \$allowed_origin {"
76
+ nginx_block="if (\$allowed_origin = 0) { return 444; }"
77
+
78
+ if grep -q "$pattern" "$nginx_conf_path"; then
79
+ echo "Map config found! nginx.conf not modified"
80
+ else
81
+ while IFS= read -r line; do
82
+ sed -i '/^\s*http\s*{/ {
83
+ :a;
84
+ N;
85
+ /\s*}\s*$/!ba;
86
+ s|\(}\)|'"$line"'\n\1|
87
+ }' "$nginx_conf_path"
88
+ done < <(printf '%s\n' "$map_config")
89
+ if [ $? -eq 0 ]; then
90
+ echo "Map config added to nginx.conf"
91
+ if grep -q "$nginx_block" "$CONFIG"; then
92
+ echo "Block Config found! OpenSpeedTest-Server.conf not modified"
93
+ else
94
+ echo "Adding Block Config to OpenSpeedTest-Server.conf"
95
+ sed -i '/location \/ {/ {
96
+ a\
97
+ '"$nginx_block"'
98
+ }' "$CONFIG"
99
+
100
+ sed -i '/location ~\* \^.+\\.(?:css|cur|js|jpe?g|gif|htc|ico|png|html|xml|otf|ttf|eot|woff|woff2|svg)\$ {/ {
101
+ a\
102
+ '"$nginx_block"'
103
+ }' "$CONFIG"
104
+ if [ $? -eq 0 ]; then
105
+ echo "Added Block to OpenSpeedTest-Server.conf"
106
+ else
107
+ echo "Failed to Add Block to OpenSpeedTest-Server.conf"
108
+ fi
109
+ fi
110
+
111
+
112
+ else
113
+ echo "Failed to add map config to nginx.conf"
114
+ fi
115
+ fi
116
+
117
+ fi
118
+
119
+
120
+ if [ "$DOMAIN_NAME" ]; then
121
+ sed -i "/\bYOURDOMAIN\b/c\ server_name _ localhost ${DOMAIN_NAME};" "${CONFIG}"
122
+ fi
123
+
124
+ nginx -g 'daemon off;' & sleep 5
125
+
126
+ if [ "$ENABLE_LETSENCRYPT" = True ] && [ "$DOMAIN_NAME" ] && [ "$USER_EMAIL" ]; then
127
+
128
+ fullchain_path="/var/log/letsencrypt/live/${DOMAIN_NAME}/fullchain.pem"
129
+
130
+ certbot certonly -n --webroot --webroot-path /usr/share/nginx/html --no-redirect --agree-tos --email "$USER_EMAIL" -d "$DOMAIN_NAME" --config-dir /var/log/letsencrypt/ --work-dir /var/log/letsencrypt/work --logs-dir /var/log/letsencrypt/log
131
+
132
+ if [ $? -eq 0 ]; then
133
+
134
+ if [ -f "$fullchain_path" ]; then
135
+ sed -i "/\bssl_certificate\b/c\ssl_certificate \/var\/log\/letsencrypt\/live\/${DOMAIN_NAME}\/fullchain.pem;" "${CONFIG}"
136
+ sed -i "/\bssl_certificate_key\b/c\ssl_certificate_key \/var\/log\/letsencrypt\/live\/${DOMAIN_NAME}\/privkey.pem;" "${CONFIG}"
137
+ nginx -s reload
138
+ echo "Let's Encrypt certificate obtained successfully."
139
+ random_minute=$(shuf -i 0-59 -n 1)
140
+ random_hour=$(shuf -i 0-23 -n 1)
141
+ echo "$random_minute $random_hour * * * /renew.sh > /proc/1/fd/1 2>&1" > /etc/crontabs/nginx
142
+ else
143
+ echo "letsencrypt Certificates Not Found!"
144
+ fi
145
+ else
146
+ echo "Failed to obtain Let's Encrypt certificate."
147
+ fi
148
+ fi
149
+
150
+ crond -b -l 5
151
+
152
+ tail -f /dev/null
files/nginx.conf ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ worker_processes auto;
2
+ #worker_rlimit_nofile 100000;
3
+ events {
4
+ worker_connections 2048;
5
+ multi_accept on;
6
+ }
7
+
8
+ error_log /var/log/nginx/error.log notice;
9
+ pid /tmp/nginx.pid;
10
+
11
+ http {
12
+ include mime.types;
13
+ default_type application/octet-stream;
14
+ include /etc/nginx/conf.d/*.conf;
15
+
16
+
17
+ }
18
+
19
+
files/nginx.crt ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ -----BEGIN CERTIFICATE-----
2
+ MIID7jCCAtYCCQDL3zw96EIXRDANBgkqhkiG9w0BAQsFADCBuDELMAkGA1UEBhMC
3
+ VVMxEzARBgNVBAgMCkNhbGlmb3JuaWExFzAVBgNVBAcMDlNpbGljb24gVmFsbGV5
4
+ MRYwFAYDVQQKDA1PcGVuU3BlZWRUZXN0MR0wGwYDVQQLDBRPcGVuU3BlZWRUZXN0
5
+ LVNlcnZlcjEaMBgGA1UEAwwRT3BlblNwZWVkVGVzdC5jb20xKDAmBgkqhkiG9w0B
6
+ CQEWGXN1cHBvcnRAb3BlbnNwZWVkdGVzdC5jb20wHhcNMjIwNjI5MDY1NjI5WhcN
7
+ MzAxMTE5MDY1NjI5WjCBuDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlmb3Ju
8
+ aWExFzAVBgNVBAcMDlNpbGljb24gVmFsbGV5MRYwFAYDVQQKDA1PcGVuU3BlZWRU
9
+ ZXN0MR0wGwYDVQQLDBRPcGVuU3BlZWRUZXN0LVNlcnZlcjEaMBgGA1UEAwwRT3Bl
10
+ blNwZWVkVGVzdC5jb20xKDAmBgkqhkiG9w0BCQEWGXN1cHBvcnRAb3BlbnNwZWVk
11
+ dGVzdC5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC4SfXrpg67
12
+ qFG+ZPJq1HGzQfbWz5HhAA87VxmSPkntBx2L3qUhjHQvYyFtLqcnRz22LMEVR97w
13
+ OgOg9QxUAJQPo9t10+Kc/xTydEufBGxcQPElwr9u9guBxY9FopRPzHcfFhDBCuHw
14
+ IZug0RKGI8f0/4Di5mJlmceOT2KwRoILvXxbDjFEBwSHlILFgkPNX6yROOQ+m/3s
15
+ yF7wOzKvcCL4wijpa/MAjPjPCfKkkV0hR26XENqn5X9AGlM+khXNG6qChlIptAHB
16
+ tyawtlysaMljznp4NoveBmZVNfGcFBIpz2Xw/ddMRQL7tjCkXGtpvcAiFWXuxEpn
17
+ BApDc//vIRXfAgMBAAEwDQYJKoZIhvcNAQELBQADggEBAHWGImuQ3eg+mYz7kGkQ
18
+ LimojW9zuWbpBOsXQ/e66tsv7iffwa3bRNoFgGu4zSmTr8WV2lUcIFIfOoyPKZt/
19
+ mBUaesv7HljVIyuZVDSuDiIh08IPHaUv4aDOa3fGY5R3aEacIfOUYNKAmb5q4Wyl
20
+ tTDrselCkZienndg7+7zp2dQW3G6PIyZ4rIp+FYYScqx3RKKkbA3fvcdFQH/1PNM
21
+ 5NUCX/VJGal4Cs7gI/11i9bdeSLeUgMKyQ9f/F9NpoatKiTLJHNteHRtvIyxeuP9
22
+ NktI/lotpVXSEerL9Y6BBW8KGA5meSFLBmCR0aPEGCIjD4SCRrOkFUfb97KyEpEf
23
+ GdU=
24
+ -----END CERTIFICATE-----
files/nginx.key ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ -----BEGIN RSA PRIVATE KEY-----
2
+ MIIEpAIBAAKCAQEAuEn166YOu6hRvmTyatRxs0H21s+R4QAPO1cZkj5J7Qcdi96l
3
+ IYx0L2MhbS6nJ0c9tizBFUfe8DoDoPUMVACUD6PbddPinP8U8nRLnwRsXEDxJcK/
4
+ bvYLgcWPRaKUT8x3HxYQwQrh8CGboNEShiPH9P+A4uZiZZnHjk9isEaCC718Ww4x
5
+ RAcEh5SCxYJDzV+skTjkPpv97Mhe8Dsyr3Ai+MIo6WvzAIz4zwnypJFdIUdulxDa
6
+ p+V/QBpTPpIVzRuqgoZSKbQBwbcmsLZcrGjJY856eDaL3gZmVTXxnBQSKc9l8P3X
7
+ TEUC+7YwpFxrab3AIhVl7sRKZwQKQ3P/7yEV3wIDAQABAoIBADq/eSHyAehYtBZZ
8
+ 392mc8iNUr8P1JVBi5mDHqe8K5zgE88u3r1fJPqmQ1Wm9apTz5xvj+3Ux4EVPWrm
9
+ M1PkC08hESjyrt8Vgfv4jtLWeiS+nyFGf/hDf0+TRyUPuu/lYmQKiLTBX11JmW8e
10
+ tyUD6w5zFQdAIkX5S+BV9kPzdil/Z5SCW7KdzBX2cb3aTh2Q89eiv73rt6eQQkhA
11
+ yi8qcaexWBAvyXEUrbn+5ozixLKZOpGBPCNzklCdc9EqtEXutg8BnXzZjKcvBLLq
12
+ HUd15akZdDuX92I8cNbYb98tAqNOi4UixYwquxMQIT5iTf+JP7rymaCwZImKl+Fn
13
+ EdJYPyECgYEA5ryo8e2t2TEUPpSRebt3eflXyUEUexU5+cvEGfjiGZIi1fNI3iqM
14
+ cEXSUCyH/2TyWd+vyO8Qy1VUPZxhFbangmHVr4u5nZt4o1u702DC0kXOOT0Vg6jb
15
+ wrgk15QvyY+0y/cuRNqfVk9kDuUnkefNuPz9Ruh+Otk1yAH24dTbbzsCgYEAzHdn
16
+ 17W2ERHAoBa3sD28p+zvknpsb6MpTj8j49PbhIv7t+lYojsK/OlTd8fEI5ad803n
17
+ TGIg8mhZtZVFFBPeUjWsBZhacLAf4XbQFnxHvyfQjEIvQjaXEcG2r8X1Bi8kE1ad
18
+ fvMKaFNexg9ZjnHSPITKOx5ECUGmDMgYD24cEa0CgYEAsovAi9zozw1cZgSfAbzf
19
+ +iHJHXHfwFKvly1nZNWjWDgt/rMQauIv5F0THnknD6j0pDkklG7x5vXzhu1wbtX1
20
+ jz3XlcygaGY7FuXQVQQmHYJozwAGmufajjXiRHNl+ynZtI9kXWFzNN2gRqpqUUw3
21
+ c/NIpksYCr+0Dz395cjJuKsCgYBa30rIpRr49SHeRJp4+sdI/tXvDPf6mdJ20zsZ
22
+ O4RZoXlLYKsi1wjoJK8TEjbK9lrW0q3U1dv8wIH2YRQlezsY4H/GsNKpOK3Cn/KV
23
+ u8CLZZ+bZqLoU6jKnIScFGf0yqjG63zt+giLG1qIvjO4Sj/846uZoLbuQj4RejCv
24
+ UumotQKBgQCKHLNqMTzAaxKPaRUQwRcHzAXygyVQ3ekKFUtRRfMJW0xRCaG1rPRD
25
+ gEAFs2R0DDavJooGbK79/oZAIv6Skq3wrNLraVaiuiobYHWxadgSZtv0+Lk3AYmE
26
+ Xw6PT515uSmqWgMEp5hOVYIO+o+2LZzeeJ6BXoA6/y5Opxqa5G5sZA==
27
+ -----END RSA PRIVATE KEY-----
files/renew.sh ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/sh
2
+
3
+
4
+ fullchain_path="/var/log/letsencrypt/live/${DOMAIN_NAME}/fullchain.pem"
5
+
6
+ if [ "$ENABLE_LETSENCRYPT" = True ] && [ "$DOMAIN_NAME" ] && [ "$USER_EMAIL" ]; then
7
+
8
+ certbot certonly -n --webroot --webroot-path /usr/share/nginx/html --no-redirect --agree-tos --email "$USER_EMAIL" -d "$DOMAIN_NAME" --config-dir /var/log/letsencrypt/ --work-dir /var/log/letsencrypt/work --logs-dir /var/log/letsencrypt/log
9
+ if [ $? -eq 0 ]; then
10
+ echo "certbot certonly -n... Executed."
11
+ if [ -f "$fullchain_path" ]; then
12
+ nginx -s reload
13
+ else
14
+ echo "letsencrypt Certificates Not Found!"
15
+ fi
16
+ else
17
+ echo "certbot certonly -n... Failed."
18
+ fi
19
+
20
+ fi
files/www/.gitignore ADDED
@@ -0,0 +1 @@
 
 
1
+ .DS_Store
files/www/License.md ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2022 OpenSpeedTest™
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
files/www/README.md ADDED
@@ -0,0 +1,421 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # **[SpeedTest by OpenSpeedTest™](https://openspeedtest.com?Run&ref=Github)** - Free & Open-Source HTML5 Network Performance Estimation Tool.
2
+
3
+
4
+
5
+ SpeedTest by OpenSpeedTest™ is a Free and Open-Source HTML5 Network Performance Estimation Tool Written in Vanilla Javascript and only uses built-in Web APIs like `XMLHttpRequest` `(XHR)`, `HTML`, `CSS`, `JS`, & `SVG`. No Third-Party frameworks or libraries are Required. All we need is a static web server like `NGINX`. I started this project in 2011 and moved to OpenSpeedTest.com dedicated Project/Domain Name in 2013.
6
+
7
+
8
+ [![Download OpenSpeedTest-Server V2.1](https://github.com/openspeedtest/v2-Test/raw/main/images/10G-S.gif)](https://go.openspeedtest.com/Server "Download OpenSpeedTest-Server V2.1")
9
+ <a target="_blank" href="https://go.openspeedtest.com/MicrosoftStore"><img src="https://github.com/openspeedtest/v2-Test/raw/main/images/Microsoft-Store-250x100.png" alt="Download from the Microsoft Store" width="200" height="80" style=""></a> <a target="_blank" href="https://go.openspeedtest.com/MacAppStore"><img src="https://github.com/openspeedtest/v2-Test/raw/main/images/Mac-App-Store-250x100.png" alt="Download from the Mac App Store" width="200" height="80" style=""></a> <a target="_blank" href="http://go.openspeedtest.com/iOS"><img src="https://github.com/openspeedtest/v2-Test/raw/main/images/App-Store-250x100.png" alt="Download from the App Store" width="200" height="80" style=""></a> <a target="_blank" href="https://go.openspeedtest.com/Android"><img src="https://github.com/openspeedtest/v2-Test/raw/main/images/GooglePlay-250x100.png" alt="Download from the Google Play Store" width="200" height="80" style=""></a> <a target="_blank" href="https://go.openspeedtest.com/snapcraft"><img src="https://github.com/openspeedtest/v2-Test/raw/main/images/SnapStore-250x100.png" alt="Download from the Snap Store" width="200" height="80" style=""></a> <a target="_blank" href="http://go.openspeedtest.com/docker"><img src="https://github.com/openspeedtest/v2-Test/raw/main/images/docker-250x100.png" alt="Download from the Docker Hub" width="200" height="80" style=""></a> <a target="_blank" href="http://go.openspeedtest.com/helm"><img src="https://github.com/openspeedtest/v2-Test/raw/main/images/Helm-Charts-250x100.png" alt="Download from the Helm Store" width="200" height="80" style=""></a> <a target="_blank" href="http://go.openspeedtest.com/Source"><img src="https://github.com/openspeedtest/v2-Test/raw/main/images/GitHub-250x100.png" alt="Download from GitHub" width="200" height="80" style=""></a>
10
+
11
+ **No client-side software or plugin is required. You can run a network speed test from any device with a [Web Browser that is IE10 or new.](https://www.youtube.com/watch?v=9f-OM_WQ7Bw&list=PLt-deStxFJOMEAs2O1lJhscMNzcg9E3Po&index=1)**
12
+
13
+ ## Why OpenSpeedTest
14
+
15
+
16
+
17
+ ### Secure by Design.
18
+
19
+
20
+
21
+ OpenSpeedTest contains Only `STATIC` Files like `HTML`,`CSS` & `JS`.
22
+
23
+ So you don't need to worry about Security Updates or Hidden Exploits that may compromise your secure environments.
24
+
25
+
26
+
27
+ ### Lightweight, High Performance.
28
+
29
+
30
+
31
+ OpenSpeedTest is written in Vanilla JavaScript. No Third-Party frameworks or libraries were used. SpeedTest script file size is under 8kB gzip. The unexpected side effect of using Vanilla JavaScript is High Performance.
32
+
33
+
34
+
35
+ ### Run a speed test from Any Device.
36
+
37
+
38
+
39
+ OpenSpeedTest will run on Any Web Browser that is IE10 or new.
40
+
41
+
42
+
43
+ ### Ready for Any Display Size and Resolution.
44
+
45
+
46
+
47
+ OpenSpeedTest User interface is written in SVG.
48
+
49
+
50
+
51
+ # Create Your Own SpeedTest Server.
52
+
53
+ ### Server Requirements :
54
+
55
+ `Nginx`, `Apache`, `IIS`, `Express`, or Any Web server that supports `HTTP/1.1` or new.
56
+
57
+ - Accept, `GET`, `POST`, `HEAD` & `OPTIONS`, Response `200 OK`.
58
+
59
+ - Accept, `POST` to Static Files, Response `200 OK`.
60
+
61
+ - `client_max_body_size`, 35 Megabytes or more.
62
+
63
+ - Timeout greater than `60 seconds`.
64
+
65
+ - Disable `Access logs` for Increasing server performance.
66
+
67
+ - Improve `Time to First Byte` (TTFB)
68
+
69
+ - Warning! If you run it behind a **[Reverse Proxy](https://github.com/openspeedtest/Speed-Test/issues/4#issuecomment-1229157193)**, you should increase the `post-body content length` to 35 megabytes.
70
+ - Supports `HTTP2` & `HTTP3`. Wait for POST-BODY and Discard the DATA for UPLOAD.
71
+ - **[You Should Follow our Nginx Config.](https://github.com/openspeedtest/Nginx-Configuration)**
72
+
73
+
74
+
75
+ # Or, You can use OpenSpeedTest-Server.
76
+
77
+ OpenSpeedTest-Server is available for Windows, Mac, Linux, Android, iOS & Docker.
78
+ [![Download OpenSpeedTest-Server V2.1](https://open.cachefly.net/assets/images/OSTV2-SS.png)](https://go.openspeedtest.com/Server "Download OpenSpeedTest-Server V2.1")
79
+ #### Fully Optimized and ready to use applications.
80
+ <a target="_blank" href="https://go.openspeedtest.com/MicrosoftStore"><img src="https://github.com/openspeedtest/v2-Test/raw/main/images/Microsoft-Store-250x100.png" alt="Download from the Microsoft Store" width="200" height="80" style=""></a> <a target="_blank" href="https://go.openspeedtest.com/MacAppStore"><img src="https://github.com/openspeedtest/v2-Test/raw/main/images/Mac-App-Store-250x100.png" alt="Download from the Mac App Store" width="200" height="80" style=""></a> <a target="_blank" href="http://go.openspeedtest.com/iOS"><img src="https://github.com/openspeedtest/v2-Test/raw/main/images/App-Store-250x100.png" alt="Download from the App Store" width="200" height="80" style=""></a> <a target="_blank" href="https://go.openspeedtest.com/Android"><img src="https://github.com/openspeedtest/v2-Test/raw/main/images/GooglePlay-250x100.png" alt="Download from the Google Play Store" width="200" height="80" style=""></a> <a target="_blank" href="https://go.openspeedtest.com/snapcraft"><img src="https://github.com/openspeedtest/v2-Test/raw/main/images/SnapStore-250x100.png" alt="Download from the Snap Store" width="200" height="80" style=""></a> <a target="_blank" href="http://go.openspeedtest.com/docker"><img src="https://github.com/openspeedtest/v2-Test/raw/main/images/docker-250x100.png" alt="Download from the Docker Hub" width="200" height="80" style=""></a> <a target="_blank" href="http://go.openspeedtest.com/helm"><img src="https://github.com/openspeedtest/v2-Test/raw/main/images/Helm-Charts-250x100.png" alt="Download from the Helm Store" width="200" height="80" style=""></a> <a target="_blank" href="http://go.openspeedtest.com/Source"><img src="https://github.com/openspeedtest/v2-Test/raw/main/images/GitHub-250x100.png" alt="Download from GitHub" width="200" height="80" style=""></a>
81
+
82
+
83
+ ### New features:
84
+
85
+
86
+
87
+ 1. Stress Test. (Continuous Speed Test)
88
+
89
+
90
+
91
+ To enable the stress test. Pass `Stress` or `S` keyword as a URL parameter.
92
+
93
+
94
+
95
+ ````
96
+
97
+ http://192.168.1.5?Stress=Low
98
+
99
+ ````
100
+
101
+ After the `STRESS` or `S` keyword, you can specify the number of seconds you need to run the StressTest in seconds, or preset values such as `Low`, `Medium`, `High`, `VeryHigh`, `Extreme`, `Day`, and `Year`. Will run a speed test for `300`,`600`,`900`,`1800`,`3600`,`86400`,`31557600` seconds, respectively. Also, you can feed the first letter of each parameter and its values.
102
+
103
+
104
+ ````
105
+
106
+ http://192.168.1.5?S=L
107
+
108
+ ````
109
+
110
+ `S=L` is the same as passing `Stress=low`
111
+
112
+ Or you can specify the number of seconds eg:`5000` directly without any preset keywords.
113
+
114
+
115
+
116
+ ````
117
+
118
+ http://192.168.1.5?Stress=5000
119
+
120
+ ````
121
+
122
+
123
+
124
+ 2. Run a speed test automatically
125
+
126
+
127
+
128
+ Run a speed test automatically on page load.
129
+
130
+ ````
131
+
132
+ http://192.168.1.5?Run
133
+
134
+ ````
135
+
136
+ Run a speed test automatically after a few seconds.
137
+
138
+ ````
139
+
140
+ http://192.168.1.5?Run=10 or http://192.168.1.5?R=10
141
+
142
+ ````
143
+
144
+
145
+
146
+ You can pass multiple keywords, and it's not `Case-Sensitive`.
147
+
148
+
149
+
150
+ ````
151
+
152
+ http://192.168.1.5?Run&Stress=300 OR http://192.168.1.5?R&S=300
153
+
154
+ ````
155
+
156
+ This will start a speed test immediately and run for `300 seconds` in each direction. That is 300 seconds for download and `300 seconds` for upload.
157
+
158
+
159
+
160
+ 3. Save results to a Database
161
+
162
+
163
+
164
+ Edit `Index.html`
165
+
166
+ ````
167
+
168
+ var saveData = true;
169
+
170
+ var saveDataURL = "//yourDatabase.Server.com:4500/save?data=";
171
+
172
+ ````
173
+
174
+ 4. Add multiple servers. The app will choose one with the least latency automatically.
175
+
176
+
177
+
178
+ Edit `Index.html`
179
+
180
+ ````
181
+
182
+ var openSpeedTestServerList = [
183
+
184
+ {"ServerName":"Home-Earth", "Download":"/downloading", "Upload":"/upload", "ServerIcon":"DefaultIcon"},
185
+
186
+ {"ServerName":"Home-Mars", "Download":"/downloading", "Upload":"/upload", "ServerIcon":"DefaultIcon"},
187
+
188
+ {"ServerName":"Home-Moon", "Download":"/downloading", "Upload":"/upload", "ServerIcon":"DefaultIcon"}
189
+
190
+ ];
191
+
192
+ ````
193
+
194
+ 5. Disable or change Overhead Compensation factor.
195
+
196
+
197
+
198
+ ````
199
+
200
+ http://192.168.1.5?clean
201
+
202
+ ````
203
+
204
+ Overhead Compensation factor, This is browser based test, Many Unknowns. Currently 4%. That is within the margin of error.
205
+
206
+ You can pass `Clean` or `C` as a URL Parameter and reset Overhead Compensation factor to Zero or set any value between 0 and 4. 1 = 1% to 4 = 4%.
207
+
208
+ `Clean` will not accept values above 4, so Compensation is limited to maximum 4%.
209
+
210
+
211
+
212
+ 6. Change the default limit of 6 parallel HTTP connections to the Server.
213
+
214
+
215
+
216
+ ````
217
+
218
+ http://192.168.1.5?XHR=3 OR http://192.168.1.5?X=3
219
+
220
+ ````
221
+
222
+ Allow the user to Change the default limit of 6 parallel HTTP connections to the Server. `XHR` will Accept values above 1 and max 32
223
+
224
+ pass `XHR` or `X` as a URL Parameter.
225
+
226
+
227
+
228
+ 7. Select a different server to run a speed test.
229
+
230
+
231
+
232
+ ````
233
+
234
+ 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
235
+
236
+ ````
237
+
238
+ Pass `Host` or `H` as a URL Parameter.
239
+
240
+ `HOST` will Accept only valid HTTP URLs like `http://192.168.1.10:3000` or `https://yourHost.com`.
241
+
242
+
243
+
244
+ 8. Select and run one test at a time, `DOWNLOAD`, `UPLOAD`, or `PING`.
245
+
246
+
247
+
248
+ ````
249
+
250
+ http://192.168.1.5?Test=Upload OR http://192.168.1.5?T=U
251
+
252
+ ````
253
+
254
+ `TEST` Allow the user to select and run one test at a time, Download, Upload, or Ping.
255
+
256
+ Pass `Test` or `T` as a URL Parameter.
257
+
258
+
259
+
260
+ 9. Set a PingTimeout dynamically by passing `Out` or `O` as a URL Parameter
261
+
262
+
263
+
264
+ ````
265
+
266
+ http://192.168.1.5?Out=7000 OR http://192.168.1.5?O=7000
267
+
268
+ ````
269
+
270
+ If Server not responded within 5 Seconds for any requests we send ('pingSamples' times)
271
+
272
+ We will show `Network Error`, You can change the limit here.
273
+
274
+ In milliseconds, if you need to set `6 seconds`. Change the value to `6000`.
275
+
276
+
277
+
278
+ 10. Set the Number of ping samples by adding `Ping` or `P` as a URL Parameter
279
+
280
+
281
+
282
+ ````
283
+
284
+ http://192.168.1.5?Ping=500 OR http://192.168.1.5?P=500
285
+
286
+ ````
287
+
288
+ More samples = more accurate representation. `Ping = 500` will send `501` requests to server to find the accurate ping value.
289
+ Take a look at index.html, you can set a custom ping sample size, threads, upload data size etc.
290
+
291
+ ## Self-hosted (On-Premise) / (Docker Image/Source Code)
292
+ ### For Headless large-scale deployments.
293
+ You have two options here. If you need a custom deployment, use our source code along with a web server of your choice. I prefer Nginx, and you can find my [Nginx Configuration](https://github.com/openspeedtest/Nginx-Configuration) here. Or you can use our docker image. You can deploy it on your LAN/WAN with or without an active internet connection.
294
+
295
+ **This is docker implementation using nginxinc/nginx-unprivileged:stable-alpine. uses significantly fewer resources.**
296
+
297
+ - NGINX Docker image that runs NGINX as a non root, unprivileged user.
298
+
299
+ ### Docker install instructions:
300
+
301
+ Install Docker and run the following command!
302
+
303
+ ````bash
304
+
305
+ sudo docker run --restart=unless-stopped --name openspeedtest -d -p 3000:3000 -p 3001:3001 openspeedtest/latest
306
+
307
+ ````
308
+ #### Or use docker-compose.yml
309
+ ````
310
+ version: '3.3'
311
+ services:
312
+ speedtest:
313
+ restart: unless-stopped
314
+ container_name: openspeedtest
315
+ ports:
316
+ - '3000:3000'
317
+ - '3001:3001'
318
+ image: openspeedtest/latest
319
+ ````
320
+ - Warning! If you run it behind a **[Reverse Proxy](https://github.com/openspeedtest/Speed-Test/issues/4#issuecomment-1229157193)**, you should increase the `post-body content length` to 35 megabytes.
321
+
322
+ - **[Follow our Nginx Config.](https://github.com/openspeedtest/Nginx-Configuration)**
323
+
324
+ Now open your browser and direct it to:
325
+
326
+ A: For **HTTP** use: `http://YOUR-SERVER-IP:3000`
327
+
328
+ B: For **HTTPS** use: `https://YOUR-SERVER-IP:3001`
329
+
330
+ #### Container-Port for http is 3000
331
+ If you need to run this image on a different port for `HTTP`, Eg: change to `80` = `-p 80:3000`
332
+ #### Container-Port for https is 3001
333
+ If you need to run this image on a different port for `HTTPS`, Eg: change to `443` = `-p 443:3001`
334
+
335
+ ### How to use your own SSL Certificate?
336
+
337
+ You can mount a folder with your own SSL certificate to this docker container by adding the following line to the above command.
338
+
339
+
340
+
341
+ ````bash
342
+
343
+ -v /${PATH-TO-YOUR-OWN-SSL-CERTIFICATE}:/etc/ssl/
344
+
345
+ ````
346
+
347
+ The folder needs to contain:
348
+
349
+ - `nginx.crt`
350
+
351
+ - `nginx.key`
352
+
353
+
354
+
355
+ I am adding a folder with nginx.crt and nginx.key from my desktop by using the following command.
356
+
357
+ ````bash
358
+
359
+ sudo docker run -v /Users/vishnu/Desktop/docker/:/etc/ssl/ --restart=unless-stopped --name openspeedtest -d -p 3000:3000 -p 3001:3001 openspeedtest/latest
360
+
361
+ ````
362
+
363
+ Docker images run better on Linux Platforms, including your NAS. But if you install docker on macOS or Windows, you may see poor performance. I asked this on Docker forums, and they told me macOS and Windows support is for Development purposes only. For Production, you need to use any Linux Platform.
364
+
365
+ The same Story goes for Windows NGINX. Nginx uses only one worker even if you specify n number of worker processes. They will show in Task Manager, but the system will only use one. I got this information directly from the Nginx website.
366
+
367
+
368
+
369
+
370
+
371
+ ## Why do you need to Create Your Own SpeedTest Server?
372
+
373
+ You can run OpenSpeedTest Server in your Home Lab, Office Server or Cloud Server. So that you or employees who work from home can run a speed test to your office and make sure they can run everything smoothly.
374
+
375
+
376
+
377
+ **Choosing between ISP1 & ISP2.**
378
+
379
+
380
+
381
+ Sometimes your ISP2 is Faster than ISP1 when you test your speed on popular speed test sites. But when you connect to your Home/Office/Cloud, that slower connection may perform better. The only way to find out is to run a speed test against your infrastructure.
382
+
383
+
384
+
385
+ **Troubleshooting network issues.**
386
+
387
+
388
+
389
+ It is common even when your Internet connection is working fine, but some of the devices in your network may experience trouble getting decent connectivity to the internet. The issue might be the wrong VLAN ID or Faulty Switch. If you run a Local network speed test, you can find and fix these issues easily.
390
+
391
+
392
+
393
+ **Before you add a repeater.**
394
+
395
+
396
+
397
+ Most repeaters will reduce your network speed by 50%, so if you put it far away, it will perform worst, and if you put it too close, you will not get enough coverage if you run a Local Network speed test. Depending on the application requirements, you can decide exactly where you need to put your repeater.
398
+
399
+
400
+
401
+ **Browsing experience.**
402
+
403
+
404
+
405
+ Many useful browser extensions are out there that we all know and love. But some of them are really slowing you down for **few seconds per page you visit**. You may see good performance when you test your network performance via File Transfer or Command-line utilities, but you may experience poor performance when browsing the internet. This is due to a bad browser configuration that including unwanted extensions installed. From my experience, only keep the one you are going to use every single day. Extension that you may use once in a while should be removed or disabled for maximum performance. If you see poor performance, try OpenSpeedTest from Private Window or Incognito Window. **This tool can be used to check the browser performance and impact of Extensions on your browsing experience.**
406
+
407
+
408
+
409
+ **No client-side software or plugin is required. You can run a network speed test from any device with a [Web Browser that is IE10 or new.](https://www.youtube.com/watch?v=9f-OM_WQ7Bw&list=PLt-deStxFJOMEAs2O1lJhscMNzcg9E3Po&index=1)**
410
+
411
+ - Like this Project? Please **Donate NOW & Keep us Alive** -> https://go.openspeedtest.com/Donate
412
+
413
+ MIT License
414
+
415
+ Copyright (c) 2013 - 2023 OpenSpeedTest™
416
+
417
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
418
+
419
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
420
+
421
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
files/www/assets/css/app.css ADDED
@@ -0,0 +1,382 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* roboto-regular - latin */
2
+ @font-face {
3
+ font-family: "Roboto";
4
+ font-style: normal;
5
+ font-weight: 400;
6
+ font-display: swap;
7
+ src: url("..fonts/roboto-v30-latin-regular.eot"); /* IE9 Compat Modes */
8
+ src: local(""),
9
+ url("../fonts/roboto-v30-latin-regular.eot?#iefix")
10
+ format("embedded-opentype"),
11
+ /* IE6-IE8 */ url("../fonts/roboto-v30-latin-regular.woff2")
12
+ format("woff2"),
13
+ /* Super Modern Browsers */
14
+ url("../fonts/roboto-v30-latin-regular.woff") format("woff"),
15
+ /* Modern Browsers */ url("../fonts/roboto-v30-latin-regular.ttf")
16
+ format("truetype"),
17
+ /* Safari, Android, iOS */
18
+ url("../fonts/roboto-v30-latin-regular.svg#Roboto") format("svg"); /* Legacy iOS */
19
+ }
20
+ /* roboto-500 - latin */
21
+ @font-face {
22
+ font-family: "Roboto";
23
+ font-style: normal;
24
+ font-weight: 500;
25
+ font-display: swap;
26
+ src: url("assets/fonts/roboto-v30-latin-500.eot"); /* IE9 Compat Modes */
27
+ src: local(""),
28
+ url("assets/fonts/roboto-v30-latin-500.eot?#iefix")
29
+ format("embedded-opentype"),
30
+ /* IE6-IE8 */ url("../fonts/roboto-v30-latin-500.woff2")
31
+ format("woff2"),
32
+ /* Super Modern Browsers */ url("../fonts/roboto-v30-latin-500.woff")
33
+ format("woff"),
34
+ /* Modern Browsers */ url("../fonts/roboto-v30-latin-500.ttf")
35
+ format("truetype"),
36
+ /* Safari, Android, iOS */
37
+ url("../fonts/roboto-v30-latin-500.svg#Roboto") format("svg"); /* Legacy iOS */
38
+ }
39
+
40
+ body {
41
+ margin: 0px;
42
+ padding: 0px;
43
+ display: block;
44
+ }
45
+
46
+ ::-webkit-scrollbar {
47
+ display: none;
48
+ }
49
+ html {
50
+ -ms-overflow-style: none;
51
+ scrollbar-width: none;
52
+ }
53
+
54
+ .Credits {
55
+ color: rgb(125 119 119);
56
+ text-align: center;
57
+ font-size:14px;
58
+ font-family: Roboto-Medium, Roboto;
59
+ font-weight: 500;
60
+ }
61
+ .Credits a {
62
+ text-decoration: none;
63
+ color: rgb(113, 113, 113);
64
+ }
65
+ .Credits a:hover {
66
+ color: #14b0fe;
67
+ }
68
+
69
+ .ConnectError {
70
+ display: none;
71
+
72
+ }
73
+
74
+ .openSpeedtestApp {
75
+
76
+ height: 100vh;
77
+ width: 100vw;
78
+ display: none;
79
+ overflow: hidden;
80
+ }
81
+ .main-Gaugebg {
82
+ fill: none;
83
+ stroke: rgb(231, 231, 232);
84
+ stroke-linecap: round;
85
+ stroke-linejoin: round;
86
+ stroke-width: 22px;
87
+ stroke-dasharray: 681;
88
+ }
89
+ .main-GaugeBlue {
90
+ fill: none;
91
+ stroke: url(#gradient);
92
+ stroke-linecap: round;
93
+ stroke-linejoin: round;
94
+ stroke-width: 22px;
95
+ stroke-dasharray: 681;
96
+ stroke-opacity: 0;
97
+ }
98
+ .main-GaugeWhite {
99
+ fill: none;
100
+ stroke: rgb(255, 255, 255);
101
+ stroke-linecap: round;
102
+ stroke-linejoin: round;
103
+ stroke-width: 15px;
104
+ stroke-dasharray: 0, 681;
105
+ stroke-dashoffset: 1;
106
+ stroke-opacity: 0;
107
+ }
108
+ .oDo-Meter {
109
+ font-size: 16.633283615112305px;
110
+ fill: gray;
111
+ font-family: Roboto-Medium, Roboto;
112
+ font-weight: 500;
113
+ }
114
+ .oDoLive-Speed {
115
+ font-size: 28px;
116
+ fill: #201e1e;
117
+ font-family: Roboto-Medium, Roboto;
118
+ font-weight: 500;
119
+ text-anchor: middle;
120
+ }
121
+
122
+ .oDoLive-Status {
123
+ font-size: 10px;
124
+ fill: #d2d1d2;
125
+ font-family: Roboto-Medium, Roboto;
126
+ font-weight: 500;
127
+ text-anchor: middle;
128
+ }
129
+ .uiBg {
130
+ fill: #d2d1d2;
131
+ }
132
+ .progressbg {
133
+ stroke: rgb(231, 231, 232);
134
+ stroke-width: 8px;
135
+ stroke-linecap: round;
136
+ stroke-linejoin: round;
137
+ stroke-dasharray: 400;
138
+ stroke-dashoffset: 0;
139
+ }
140
+ .Cards {
141
+ fill: #f2f2f2;
142
+ }
143
+ .Symbol {
144
+ fill: url(#gradient);
145
+ }
146
+ .rtext {
147
+ font-size: 12px;
148
+ fill: #333;
149
+ font-family: Roboto-Medium, Roboto;
150
+ font-weight: 500;
151
+ }
152
+ .rtextnum {
153
+ font-size: 23px;
154
+ fill: #201e1e;
155
+ font-family: Roboto-Medium, Roboto;
156
+ font-weight: 500;
157
+ text-anchor: middle;
158
+ }
159
+ .rtextmbms {
160
+ font-size: 12px;
161
+ fill: #5f5f5f;
162
+ font-family: Roboto-Medium, Roboto;
163
+ font-weight: 500;
164
+ text-anchor: middle;
165
+ }
166
+ .jitter-Mob {
167
+ font-size: 9px;
168
+ fill: #5f5f5f;
169
+ font-family: Roboto-Medium, Roboto;
170
+ font-weight: 500;
171
+ text-anchor: middle;
172
+ }
173
+ .startButton {
174
+ fill: url(#RadialGradient1);
175
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
176
+ -webkit-tap-highlight-color: transparent;
177
+ cursor: pointer;
178
+ pointer-events: visible;
179
+ }
180
+ .buttonTxt {
181
+ font-size: 40px;
182
+ fill: #ffffff;
183
+ font-family: Roboto-Medium, Roboto;
184
+ font-weight: 500;
185
+ text-anchor: middle;
186
+ }
187
+
188
+ .intro-Progress {
189
+ stroke: #56c4fb;
190
+ stroke-width: 8px;
191
+ stroke-linecap: round;
192
+ stroke-linejoin: round;
193
+ stroke-dasharray: 400;
194
+ stroke-dashoffset: 0;
195
+ }
196
+ .progressElmstart {
197
+ stroke: #56c4fb;
198
+ stroke-width: 8px;
199
+ stroke-linecap: round;
200
+ stroke-linejoin: round;
201
+ stroke-dasharray: 400;
202
+ stroke-dashoffset: 0;
203
+ display: block;
204
+ }
205
+ .Startsettings {
206
+ fill: url(#RadialGradient1);
207
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
208
+ -webkit-tap-highlight-color: transparent;
209
+ cursor: pointer;
210
+ pointer-events: visible;
211
+ opacity: 0.1;
212
+ transition: opacity 1s ease-in-out;
213
+ }
214
+ .Startsettings:hover {
215
+ opacity: 1;
216
+ }
217
+
218
+ .progressbg {
219
+ stroke: rgb(231, 231, 232);
220
+ stroke-width: 8px;
221
+ stroke-linecap: round;
222
+ stroke-linejoin: round;
223
+ stroke-dasharray: 400;
224
+ stroke-dashoffset: 0;
225
+ }
226
+ .deskStart {
227
+ fill: none;
228
+ stroke: rgb(231, 231, 232);
229
+ stroke-linecap: round;
230
+ stroke-linejoin: round;
231
+ stroke-width: 22px;
232
+ stroke-dasharray: 681;
233
+ stroke: url(#gradient);
234
+ }
235
+ #UI-Desk {
236
+ display: none;
237
+ }
238
+ #UI-Mob {
239
+ display: none;
240
+ }
241
+ .oDoTop-Speed {
242
+ font-size: 16.96px;
243
+ fill: gray;
244
+ font-family: Roboto-Medium, Roboto;
245
+ font-weight: 500;
246
+ text-anchor: end;
247
+ }
248
+ #upSymbolDesk {
249
+ fill: #14b0fe;
250
+ display: none;
251
+ }
252
+ #downSymbolDesk {
253
+ fill: #14b0fe;
254
+ display: none;
255
+ }
256
+ #upSymbolMob {
257
+ fill: #14b0fe;
258
+ display: none;
259
+ }
260
+ #downSymbolMob {
261
+ fill: #14b0fe;
262
+ display: none;
263
+ }
264
+
265
+ #ipMob {
266
+ font-size: 15px;
267
+ fill: #201e1e;
268
+ font-family: Roboto-Medium, Roboto;
269
+ font-weight: 500;
270
+ text-anchor: middle;
271
+ display: none;
272
+ }
273
+ #ipDesk {
274
+ font-size: 15px;
275
+ fill: #201e1e;
276
+ font-family: Roboto-Medium, Roboto;
277
+ font-weight: 500;
278
+ text-anchor: middle;
279
+ display: none;
280
+ }
281
+
282
+ .spinner {
283
+ position: absolute;
284
+ z-index: 999;
285
+ top: 50vh;
286
+ left: 50vw;
287
+ text-align: center;
288
+ }
289
+
290
+ .spinner > div {
291
+ width: 20px;
292
+ height: 20px;
293
+ background-color: #2196f3;
294
+
295
+ border-radius: 100%;
296
+ display: inline-block;
297
+ -webkit-animation: sk-bouncedelay 1.4s infinite ease-in-out both;
298
+ animation: sk-bouncedelay 1.4s infinite ease-in-out both;
299
+ }
300
+
301
+ .spinner .bounce1 {
302
+ -webkit-animation-delay: -0.32s;
303
+ animation-delay: -0.32s;
304
+ }
305
+
306
+ .spinner .bounce2 {
307
+ -webkit-animation-delay: -0.16s;
308
+ animation-delay: -0.16s;
309
+ }
310
+
311
+ @-webkit-keyframes sk-bouncedelay {
312
+ 0%,
313
+ 80%,
314
+ 100% {
315
+ -webkit-transform: scale(0);
316
+ }
317
+ 40% {
318
+ -webkit-transform: scale(1);
319
+ }
320
+ }
321
+
322
+ @keyframes sk-bouncedelay {
323
+ 0%,
324
+ 80%,
325
+ 100% {
326
+ -webkit-transform: scale(0);
327
+ transform: scale(0);
328
+ }
329
+ 40% {
330
+ -webkit-transform: scale(1);
331
+ transform: scale(1);
332
+ }
333
+ }
334
+
335
+ .darkmode {
336
+ margin-bottom: -15px;
337
+ fill: #75757a99;
338
+ padding-top: 16px;
339
+ display: none;
340
+ cursor: pointer;
341
+ margin-right: 30px;
342
+ }
343
+ #daymode {
344
+ margin-right: 40px;
345
+ }
346
+ .darkmode:hover {
347
+ fill: #000000;
348
+ }
349
+
350
+ .Mobile,
351
+ .Desktop {
352
+ visibility: hidden;
353
+ width: 100vw;
354
+ height: 100vh;
355
+ }
356
+
357
+ @media only screen and (orientation: landscape) {
358
+ .Mobile {
359
+ visibility: hidden;
360
+ }
361
+ .Desktop {
362
+ visibility: visible;
363
+ }
364
+ }
365
+
366
+ @media only screen and (orientation: portrait) {
367
+ .spinner {
368
+ top: 42vh;
369
+ left: 42vw;
370
+ }
371
+ .Mobile {
372
+ visibility: visible;
373
+ }
374
+ .Desktop {
375
+ visibility: hidden;
376
+ }
377
+ }
378
+ @media only screen and (max-width: 300px) {
379
+ .Credits{
380
+ display: none;
381
+ }
382
+ }
files/www/assets/css/darkmode.css ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ body {
2
+ background-color: #181818;
3
+ }
4
+ #ipDesk {
5
+ fill: aliceblue;
6
+ }
7
+
8
+ .oDoLive-Speed {
9
+ fill: #ffffff;
10
+ }
11
+ .oDoLive-Status {
12
+ fill: aliceblue;
13
+ }
14
+ #ipMob {
15
+ fill: aliceblue;
16
+ }
17
+ .rtextnum {
18
+ fill: #ffffff;
19
+ }
20
+ .rtextmbms {
21
+ fill: #ffffff;
22
+ }
23
+ .rtext {
24
+ fill: #ffffff;
25
+ }
26
+ .Cards {
27
+ fill: #000000;
28
+ }
29
+
30
+ .main-Gaugebg {
31
+ stroke: #000000;
32
+ }
33
+ .uiBg {
34
+ fill: #000000;
35
+ }
36
+ .progressbg {
37
+ stroke: #202020;
38
+ }
39
+ .jitter-Mob {
40
+ fill: #ffffff;
41
+ }
42
+
43
+ .ConnectError {
44
+ fill: #ffffff;
45
+ }
files/www/assets/fonts/roboto-v30-latin-500.eot ADDED
Binary file (18.1 kB). View file
 
files/www/assets/fonts/roboto-v30-latin-500.svg ADDED
files/www/assets/fonts/roboto-v30-latin-500.ttf ADDED
Binary file (36.5 kB). View file
 
files/www/assets/fonts/roboto-v30-latin-500.woff ADDED
Binary file (20.5 kB). View file
 
files/www/assets/fonts/roboto-v30-latin-500.woff2 ADDED
Binary file (15.9 kB). View file
 
files/www/assets/fonts/roboto-v30-latin-regular.eot ADDED
Binary file (17.8 kB). View file
 
files/www/assets/fonts/roboto-v30-latin-regular.svg ADDED
files/www/assets/fonts/roboto-v30-latin-regular.ttf ADDED
Binary file (36.2 kB). View file
 
files/www/assets/fonts/roboto-v30-latin-regular.woff ADDED
Binary file (20.3 kB). View file
 
files/www/assets/fonts/roboto-v30-latin-regular.woff2 ADDED
Binary file (15.7 kB). View file
 
files/www/assets/images/app.svg ADDED
files/www/assets/images/icons/android-chrome-192x192.png ADDED
files/www/assets/images/icons/android-chrome-512x512.png ADDED
files/www/assets/images/icons/apple-touch-icon.png ADDED
files/www/assets/images/icons/browserconfig.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <browserconfig>
3
+ <msapplication>
4
+ <tile>
5
+ <square150x150logo src="/images/icons/mstile-150x150.png"/>
6
+ <TileColor>#ffc40d</TileColor>
7
+ </tile>
8
+ </msapplication>
9
+ </browserconfig>
files/www/assets/images/icons/favicon-16x16.png ADDED
files/www/assets/images/icons/favicon-32x32.png ADDED
files/www/assets/images/icons/favicon.ico ADDED
files/www/assets/images/icons/launcher-icon-1x.png ADDED
files/www/assets/images/icons/launcher-icon-2x.png ADDED
files/www/assets/images/icons/launcher-icon-3x.png ADDED
files/www/assets/images/icons/launcher-icon-4x.png ADDED
files/www/assets/images/icons/mstile-150x150.png ADDED
files/www/assets/images/icons/safari-pinned-tab.svg ADDED
files/www/assets/images/icons/site.webmanifest ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "OpenSpeedTest",
3
+ "short_name": "Speed Test",
4
+ "icons": [
5
+ {
6
+ "src": "/assets/images/icons/android-chrome-192x192.png",
7
+ "sizes": "192x192",
8
+ "type": "image/png"
9
+ },
10
+ {
11
+ "src": "/assets/images/icons/android-chrome-512x512.png",
12
+ "sizes": "512x512",
13
+ "type": "image/png"
14
+ }
15
+ ],
16
+ "theme_color": "#ffffff",
17
+ "background_color": "#ffffff",
18
+ "display": "standalone",
19
+ "start_url": "/"
20
+
21
+
22
+ }
files/www/assets/js/app-2.5.4.js ADDED
@@ -0,0 +1,1427 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Official Website : https://OpenSpeedTest.COM | Email: support@openspeedtest.com
3
+ Developed by : Vishnu | https://Vishnu.Pro | Email : me@vishnu.pro
4
+ Like this Project? Please Donate NOW & Keep us Alive -> https://go.openspeedtest.com/Donate
5
+ Speed Test by OpenSpeedTest™️ is Free and Open-Source Software (FOSS) with MIT License.
6
+ Read full license terms @ http://go.openspeedtest.com/License
7
+ If you have any Questions, ideas or Comments Please Send it via -> https://go.openspeedtest.com/SendMessage
8
+ */
9
+ window.onload = function() {
10
+ var appSVG = document.getElementById("OpenSpeedTest-UI");
11
+ appSVG.parentNode.replaceChild(appSVG.contentDocument.documentElement, appSVG);
12
+ ostOnload();
13
+ OpenSpeedTest.Start();
14
+ };
15
+ (function(OpenSpeedTest) {
16
+ var Status;
17
+ var ProG;
18
+ var Callback = function(callback) {
19
+ if (callback && typeof callback === "function") {
20
+ callback();
21
+ }
22
+ };
23
+ function _(el) {
24
+ if (!(this instanceof _)) {
25
+ return new _(el);
26
+ }
27
+ this.el = document.getElementById(el);
28
+ }
29
+ _.prototype.fade = function fade(type, ms, callback00) {
30
+ var isIn = type === "in", opacity = isIn ? 0 : 1, interval = 14, duration = ms, gap = interval / duration, self = this;
31
+ if (isIn) {
32
+ self.el.style.display = "block";
33
+ self.el.style.opacity = opacity;
34
+ }
35
+ function func() {
36
+ opacity = isIn ? opacity + gap : opacity - gap;
37
+ self.el.style.opacity = opacity;
38
+ if (opacity <= 0) {
39
+ self.el.style.display = "none";
40
+ }
41
+ if (opacity <= 0 || opacity >= 1) {
42
+ window.clearInterval(fading, Callback(callback00));
43
+ }
44
+ }
45
+ var fading = window.setInterval(func, interval);
46
+ };
47
+ var easeOutQuint = function(t, b, c, d) {
48
+ t /= d;
49
+ t--;
50
+ return c * (t * t * t * t * t + 1) + b;
51
+ };
52
+ var easeOutCubic = function(t, b, c, d) {
53
+ t /= d;
54
+ t--;
55
+ return c * (t * t * t + 1) + b;
56
+ };
57
+ var openSpeedtestShow = function() {
58
+ this.YourIP = _("YourIP");
59
+ this.ipDesk = _("ipDesk");
60
+ this.ipMob = _("ipMob");
61
+ this.downSymbolDesk = _("downSymbolDesk");
62
+ this.upSymbolDesk = _("upSymbolDesk");
63
+ this.upSymbolMob = _("upSymbolMob");
64
+ this.downSymbolMob = _("downSymbolMob");
65
+ this.settingsMob = _("settingsMob");
66
+ this.settingsDesk = _("settingsDesk");
67
+ this.oDoLiveStatus = _("oDoLiveStatus");
68
+ this.ConnectErrorMob = _("ConnectErrorMob");
69
+ this.ConnectErrorDesk = _("ConnectErrorDesk");
70
+ this.downResult = _("downResult");
71
+ this.upRestxt = _("upRestxt");
72
+ this.pingResult = _("pingResult");
73
+ this.jitterDesk = _("jitterDesk");
74
+ this.pingMobres = _("pingMobres");
75
+ this.JitterResultMon = _("JitterResultMon");
76
+ this.JitterResultms = _("JitterResultms");
77
+ this.UI_Desk = _("UI-Desk");
78
+ this.UI_Mob = _("UI-Mob");
79
+ this.oDoTopSpeed = _("oDoTopSpeed");
80
+ this.startButtonMob = _("startButtonMob");
81
+ this.startButtonDesk = _("startButtonDesk");
82
+ this.intro_Desk = _("intro-Desk");
83
+ this.intro_Mob = _("intro-Mob");
84
+ this.loader = _("loading_app");
85
+ this.OpenSpeedtest = _("OpenSpeedtest");
86
+ this.mainGaugebg_Desk = _("mainGaugebg-Desk");
87
+ this.mainGaugeBlue_Desk = _("mainGaugeBlue-Desk");
88
+ this.mainGaugeWhite_Desk = _("mainGaugeWhite-Desk");
89
+ this.mainGaugebg_Mob = _("mainGaugebg-Mob");
90
+ this.mainGaugeBlue_Mob = _("mainGaugeBlue-Mob");
91
+ this.mainGaugeWhite_Mob = _("mainGaugeWhite-Mob");
92
+ this.oDoLiveSpeed = _("oDoLiveSpeed");
93
+ this.progressStatus_Mob = _("progressStatus-Mob");
94
+ this.progressStatus_Desk = _("progressStatus-Desk");
95
+ this.graphc1 = _("graphc1");
96
+ this.graphc2 = _("graphc2");
97
+ this.graphMob2 = _("graphMob2");
98
+ this.graphMob1 = _("graphMob1");
99
+ this.text = _("text");
100
+ this.scale = [{degree:680, value:0}, {degree:570, value:0.5}, {degree:460, value:1}, {degree:337, value:10}, {degree:220, value:100}, {degree:115, value:500}, {degree:0, value:1000},];
101
+ this.element = "";
102
+ this.chart = "";
103
+ this.polygon = "";
104
+ this.width = 200;
105
+ this.height = 50;
106
+ this.maxValue = 0;
107
+ this.values = [];
108
+ this.points = [];
109
+ this.vSteps = 5;
110
+ this.measurements = [];
111
+ this.points = [];
112
+ };
113
+ openSpeedtestShow.prototype.reset = function() {
114
+ this.element = "";
115
+ this.chart = "";
116
+ this.polygon = "";
117
+ this.width = 200;
118
+ this.height = 50;
119
+ this.maxValue = 0;
120
+ this.values = [];
121
+ this.points = [];
122
+ this.vSteps = 5;
123
+ this.measurements = [];
124
+ this.points = [];
125
+ };
126
+ openSpeedtestShow.prototype.ip = function() {
127
+ var Self = this;
128
+ if (Self.ipDesk.el.style.display === "block") {
129
+ Self.ipDesk.el.style.display = "none";
130
+ Self.ipMob.el.style.display = "none";
131
+ } else {
132
+ Self.ipDesk.el.style.display = "block";
133
+ Self.ipMob.el.style.display = "block";
134
+ }
135
+ };
136
+ openSpeedtestShow.prototype.prePing = function() {
137
+ this.loader.fade("out", 500);
138
+ this.OpenSpeedtest.fade("in", 1000);
139
+ };
140
+ openSpeedtestShow.prototype.app = function() {
141
+ this.loader.fade("out", 500, this.ShowAppIntro());
142
+ };
143
+ openSpeedtestShow.prototype.ShowAppIntro = function() {
144
+ this.OpenSpeedtest.fade("in", 1000);
145
+ };
146
+ openSpeedtestShow.prototype.userInterface = function() {
147
+ var Self = this;
148
+ this.intro_Desk.fade("out", 1000);
149
+ this.intro_Mob.fade("out", 1000, this.ShowUI());
150
+ };
151
+ openSpeedtestShow.prototype.ShowUI = function() {
152
+ this.UI_Desk.fade("in", 1000);
153
+ this.UI_Mob.fade("in", 1000, uiLoaded);
154
+ function uiLoaded(argument) {
155
+ Status = "Loaded";
156
+ console.log("Developed by Vishnu. Email --\x3e me@vishnu.pro");
157
+ }
158
+ };
159
+ openSpeedtestShow.prototype.Symbol = function(dir) {
160
+ if (dir == 0) {
161
+ this.downSymbolMob.el.style.display = "block";
162
+ this.downSymbolDesk.el.style.display = "block";
163
+ this.upSymbolMob.el.style.display = "none";
164
+ this.upSymbolDesk.el.style.display = "none";
165
+ }
166
+ if (dir == 1) {
167
+ this.downSymbolMob.el.style.display = "none";
168
+ this.downSymbolDesk.el.style.display = "none";
169
+ this.upSymbolMob.el.style.display = "block";
170
+ this.upSymbolDesk.el.style.display = "block";
171
+ }
172
+ if (dir == 2) {
173
+ this.downSymbolMob.el.style.display = "none";
174
+ this.downSymbolDesk.el.style.display = "none";
175
+ this.upSymbolMob.el.style.display = "none";
176
+ this.upSymbolDesk.el.style.display = "none";
177
+ }
178
+ };
179
+ openSpeedtestShow.prototype.Graph = function(speed, select) {
180
+ if (!("remove" in Element.prototype)) {
181
+ Element.prototype.remove = function() {
182
+ if (this.parentNode) {
183
+ this.parentNode.removeChild(this);
184
+ }
185
+ };
186
+ }
187
+ var Self = this;
188
+ var Remove;
189
+ if (select === 0) {
190
+ var Graphelement = this.graphc1.el;
191
+ Remove = "line";
192
+ this.graphMob2.el.style.display = "none";
193
+ this.graphMob1.el.style.display = "block";
194
+ } else {
195
+ Graphelement = this.graphc2.el;
196
+ Remove = "line2";
197
+ this.graphMob1.el.style.display = "none";
198
+ this.graphMob2.el.style.display = "block";
199
+ }
200
+ if (!isNaN(speed)) {
201
+ this.values.push(speed);
202
+ } else {
203
+ this.values.push("");
204
+ }
205
+ function calcMeasure() {
206
+ for (x = 0; x < Self.vSteps; x++) {
207
+ var measurement = Math.ceil(Self.maxValue / Self.vSteps * (x + 1));
208
+ Self.measurements.push(measurement);
209
+ }
210
+ Self.measurements.reverse();
211
+ }
212
+ function createChart(element, values) {
213
+ calcMaxValue();
214
+ calcPoints();
215
+ calcMeasure();
216
+ var removeLine = document.getElementsByClassName(Remove);
217
+ while (removeLine.length > 0) {
218
+ removeLine[0].remove();
219
+ }
220
+ Self.polygon = document.createElementNS("http://www.w3.org/2000/svg", "polygon");
221
+ Self.polygon.setAttribute("points", Self.points);
222
+ Self.polygon.setAttribute("class", Remove);
223
+ if (Self.values.length > 1) {
224
+ Graphelement.appendChild(Self.polygon);
225
+ }
226
+ }
227
+ function calcPoints() {
228
+ if (Self.values.length > 1) {
229
+ var points = "0," + Self.height + " ";
230
+ for (x = 0; x < Self.values.length; x++) {
231
+ var perc = Self.values[x] / Self.maxValue;
232
+ var steps = 130 / (Self.values.length - 1);
233
+ var point = (steps * x).toFixed(2) + "," + (Self.height - Self.height * perc).toFixed(2) + " ";
234
+ points += point;
235
+ }
236
+ points += "130," + Self.height;
237
+ Self.points = points;
238
+ }
239
+ }
240
+ var x;
241
+ function calcMaxValue() {
242
+ Self.maxValue = 0;
243
+ for (x = 0; x < Self.values.length; x++) {
244
+ if (Self.values[x] > Self.maxValue) {
245
+ Self.maxValue = Self.values[x];
246
+ }
247
+ }
248
+ Self.maxValue = Math.ceil(Self.maxValue);
249
+ }
250
+ if (speed > 0) {
251
+ createChart(Graphelement, speed);
252
+ }
253
+ };
254
+ openSpeedtestShow.prototype.progress = function(Switch, duration) {
255
+ var Self = this;
256
+ var Stop = duration;
257
+ var Stage = Switch;
258
+ var currTime = Date.now();
259
+ var chan2 = 0 - 400;
260
+ var interval = setInterval(function() {
261
+ var timeNow = (Date.now() - currTime) / 1000;
262
+ var toLeft = easeOutCubic(timeNow, 400, 400, Stop);
263
+ var toRight = easeOutCubic(timeNow, 400, chan2, Stop);
264
+ if (Stage) {
265
+ Self.progressStatus_Desk.el.style.strokeDashoffset = toLeft;
266
+ Self.progressStatus_Mob.el.style.strokeDashoffset = toLeft;
267
+ } else {
268
+ Self.progressStatus_Desk.el.style.strokeDashoffset = toRight;
269
+ Self.progressStatus_Mob.el.style.strokeDashoffset = toRight;
270
+ }
271
+ if (timeNow >= Stop) {
272
+ clearInterval(interval);
273
+ ProG = "done";
274
+ Self.progressStatus_Desk.el.style.strokeDashoffset = 800;
275
+ Self.progressStatus_Mob.el.style.strokeDashoffset = 800;
276
+ }
277
+ }, 14);
278
+ };
279
+ openSpeedtestShow.prototype.mainGaugeProgress = function(currentSpeed) {
280
+ var Self = this;
281
+ var speed = currentSpeed;
282
+ if (speed < 0) {
283
+ speed = 0;
284
+ }
285
+ var mainGaugeOffset = Self.getNonlinearDegree(speed);
286
+ if (currentSpeed > 0) {
287
+ this.mainGaugeBlue_Desk.el.style.strokeOpacity = 1;
288
+ this.mainGaugeWhite_Desk.el.style.strokeOpacity = 1;
289
+ this.mainGaugeBlue_Mob.el.style.strokeOpacity = 1;
290
+ this.mainGaugeWhite_Mob.el.style.strokeOpacity = 1;
291
+ this.mainGaugeBlue_Desk.el.style.strokeDashoffset = mainGaugeOffset;
292
+ this.mainGaugeWhite_Desk.el.style.strokeDashoffset = mainGaugeOffset == 0 ? 1 : mainGaugeOffset + 1;
293
+ this.mainGaugeBlue_Mob.el.style.strokeDashoffset = mainGaugeOffset;
294
+ this.mainGaugeWhite_Mob.el.style.strokeDashoffset = mainGaugeOffset == 0 ? 1 : mainGaugeOffset + 1;
295
+ }
296
+ if (mainGaugeOffset == 0 && speed > 1000) {
297
+ this.mainGaugeBlue_Mob.el.style.strokeDashoffset = mainGaugeOffset >= 681 ? 681 : mainGaugeOffset;
298
+ this.mainGaugeWhite_Mob.el.style.strokeDashoffset = mainGaugeOffset == 0 ? 1 : mainGaugeOffset + 1;
299
+ this.mainGaugeWhite_Desk.el.style.strokeDashoffset = mainGaugeOffset == 0 ? 1 : mainGaugeOffset + 1;
300
+ this.mainGaugeBlue_Desk.el.style.strokeDashoffset = mainGaugeOffset >= 681 ? 681 : mainGaugeOffset;
301
+ } else if (mainGaugeOffset == 0 && speed <= 0) {
302
+ this.mainGaugeBlue_Mob.el.style.strokeDashoffset = 681.1;
303
+ this.mainGaugeWhite_Mob.el.style.strokeDashoffset = 0.1;
304
+ this.mainGaugeWhite_Desk.el.style.strokeDashoffset = 0.1;
305
+ this.mainGaugeBlue_Desk.el.style.strokeDashoffset = 681.1;
306
+ }
307
+ };
308
+ openSpeedtestShow.prototype.showStatus = function(e) {
309
+ this.oDoLiveStatus.el.textContent = e;
310
+ };
311
+ openSpeedtestShow.prototype.ConnectionError = function() {
312
+ this.ConnectErrorMob.el.style.display = "block";
313
+ this.ConnectErrorDesk.el.style.display = "block";
314
+ };
315
+ openSpeedtestShow.prototype.uploadResult = function(upload) {
316
+ if (upload < 1) {
317
+ this.upRestxt.el.textContent = upload.toFixed(3);
318
+ }
319
+ if (upload >= 1 && upload < 9999) {
320
+ this.upRestxt.el.textContent = upload.toFixed(1);
321
+ }
322
+ if (upload >= 10000 && upload < 99999) {
323
+ this.upRestxt.el.textContent = upload.toFixed(1);
324
+ this.upRestxt.el.style.fontSize = "20px";
325
+ }
326
+ if (upload >= 100000) {
327
+ this.upRestxt.el.textContent = upload.toFixed(1);
328
+ this.upRestxt.el.style.fontSize = "18px";
329
+ }
330
+ };
331
+ openSpeedtestShow.prototype.pingResults = function(data, Display) {
332
+ var ShowData = data;
333
+ if (Display === "Ping") {
334
+ if (ShowData >= 1 && ShowData < 10000) {
335
+ this.pingResult.el.textContent = Math.floor(ShowData);
336
+ this.pingMobres.el.textContent = Math.floor(ShowData);
337
+ } else if (ShowData >= 0 && ShowData < 1) {
338
+ if (ShowData == 0) {
339
+ ShowData = 0;
340
+ }
341
+ this.pingResult.el.textContent = ShowData;
342
+ this.pingMobres.el.textContent = ShowData;
343
+ }
344
+ }
345
+ if (Display === "Error") {
346
+ this.oDoLiveSpeed.el.textContent = ShowData;
347
+ }
348
+ };
349
+ openSpeedtestShow.prototype.downloadResult = function(download) {
350
+ if (download < 1) {
351
+ this.downResult.el.textContent = download.toFixed(3);
352
+ }
353
+ if (download >= 1 && download < 9999) {
354
+ this.downResult.el.textContent = download.toFixed(1);
355
+ }
356
+ if (download >= 10000 && download < 99999) {
357
+ this.downResult.el.textContent = download.toFixed(1);
358
+ this.downResult.el.style.fontSize = "20px";
359
+ }
360
+ if (download >= 100000) {
361
+ this.downResult.el.textContent = download.toFixed(1);
362
+ this.downResult.el.style.fontSize = "18px";
363
+ }
364
+ };
365
+ openSpeedtestShow.prototype.jitterResult = function(data, Display) {
366
+ var ShowData = data;
367
+ if (Display === "Jitter") {
368
+ if (ShowData >= 1 && ShowData < 10000) {
369
+ this.jitterDesk.el.textContent = Math.floor(ShowData);
370
+ if (ShowData >= 1 && ShowData < 100) {
371
+ this.JitterResultMon.el.textContent = Math.floor(ShowData);
372
+ }
373
+ if (ShowData >= 100) {
374
+ var kData = (ShowData / 1000).toFixed(1);
375
+ this.JitterResultMon.el.textContent = kData + "k";
376
+ }
377
+ } else if (ShowData >= 0 && ShowData < 1) {
378
+ if (ShowData == 0) {
379
+ ShowData = 0;
380
+ }
381
+ this.jitterDesk.el.textContent = ShowData;
382
+ this.JitterResultMon.el.textContent = ShowData;
383
+ }
384
+ }
385
+ };
386
+ openSpeedtestShow.prototype.LiveSpeed = function(data, Display) {
387
+ var ShowData = data;
388
+ if (Display === "countDown") {
389
+ var speed = ShowData.toFixed(0);
390
+ this.oDoLiveSpeed.el.textContent = speed;
391
+ return;
392
+ }
393
+ if (Display === "speedToZero") {
394
+ if (typeof ShowData == "number") {
395
+ ShowData = ShowData.toFixed(1);
396
+ }
397
+ if (ShowData <= 0) {
398
+ ShowData = 0;
399
+ }
400
+ this.oDoLiveSpeed.el.textContent = ShowData;
401
+ this.oDoTopSpeed.el.textContent = "1000+";
402
+ this.oDoTopSpeed.el.style.fontSize = "16.9px";
403
+ this.oDoTopSpeed.el.style.fill = "gray";
404
+ return;
405
+ }
406
+ if (Display === "Ping") {
407
+ if (ShowData >= 1 && ShowData < 10000) {
408
+ this.oDoLiveSpeed.el.textContent = Math.floor(ShowData);
409
+ } else if (ShowData >= 0 && ShowData < 1) {
410
+ if (ShowData == 0) {
411
+ ShowData = 0;
412
+ }
413
+ this.oDoLiveSpeed.el.textContent = ShowData;
414
+ }
415
+ } else {
416
+ if (ShowData == 0) {
417
+ var speed = ShowData.toFixed(0);
418
+ this.oDoLiveSpeed.el.textContent = speed;
419
+ }
420
+ if (ShowData <= 1 && ShowData > 0) {
421
+ var speed = ShowData.toFixed(3);
422
+ this.oDoLiveSpeed.el.textContent = speed;
423
+ }
424
+ if (ShowData > 1) {
425
+ var speed = ShowData.toFixed(1);
426
+ this.oDoLiveSpeed.el.textContent = speed;
427
+ }
428
+ if (ShowData <= 1000) {
429
+ this.oDoTopSpeed.el.textContent = "1000+";
430
+ this.oDoTopSpeed.el.style.fontSize = "16.9px";
431
+ this.oDoTopSpeed.el.style.fill = "gray";
432
+ }
433
+ if (ShowData >= 1010) {
434
+ this.oDoTopSpeed.el.textContent = Math.floor(ShowData / 1010) * 1000 + "+";
435
+ this.oDoTopSpeed.el.style.fill = "gray";
436
+ this.oDoTopSpeed.el.style.fontSize = "17.2px";
437
+ }
438
+ }
439
+ };
440
+ openSpeedtestShow.prototype.GaugeProgresstoZero = function(currentSpeed, status) {
441
+ var speed = currentSpeed;
442
+ var Self = this;
443
+ var duration = 3;
444
+ if (speed >= 0) {
445
+ var time = Date.now();
446
+ var SpeedtoZero = 0 - speed;
447
+ var interval = setInterval(function() {
448
+ var timeNow = (Date.now() - time) / 1000;
449
+ var speedToZero = easeOutQuint(timeNow, speed, SpeedtoZero, duration);
450
+ Self.LiveSpeed(speedToZero, "speedToZero");
451
+ Self.mainGaugeProgress(speedToZero);
452
+ if (timeNow >= duration || speedToZero <= 0) {
453
+ clearInterval(interval);
454
+ Self.LiveSpeed(0, "speedToZero");
455
+ Self.mainGaugeProgress(0);
456
+ Status = status;
457
+ }
458
+ }, 16);
459
+ }
460
+ };
461
+ openSpeedtestShow.prototype.getNonlinearDegree = function(mega_bps) {
462
+ var i = 0;
463
+ if (0 == mega_bps || mega_bps <= 0 || isNaN(mega_bps)) {
464
+ return 0;
465
+ }
466
+ while (i < this.scale.length) {
467
+ if (mega_bps > this.scale[i].value) {
468
+ i++;
469
+ } else {
470
+ return this.scale[i - 1].degree + (mega_bps - this.scale[i - 1].value) * (this.scale[i].degree - this.scale[i - 1].degree) / (this.scale[i].value - this.scale[i - 1].value);
471
+ }
472
+ }
473
+ return this.scale[this.scale.length - 1].degree;
474
+ };
475
+ var openSpeedtestGet = function() {
476
+ this.OverAllTimeAvg = window.performance.now();
477
+ this.SpeedSamples = [];
478
+ this.FinalSpeed;
479
+ };
480
+ openSpeedtestGet.prototype.reset = function() {
481
+ this.OverAllTimeAvg = window.performance.now();
482
+ this.SpeedSamples = [];
483
+ this.FinalSpeed = 0;
484
+ };
485
+ openSpeedtestGet.prototype.ArraySum = function(Arr) {
486
+ var array = Arr;
487
+ if (array) {
488
+ var sum = array.reduce(function(A, B) {
489
+ if (typeof A === "number" && typeof B === "number") {
490
+ return A + B;
491
+ }
492
+ }, 0);
493
+ return sum;
494
+ } else {
495
+ return 0;
496
+ }
497
+ };
498
+ openSpeedtestGet.prototype.AvgSpeed = function(Livespeed, Start, duration) {
499
+ var Self = this;
500
+ this.timeNow = (window.performance.now() - this.OverAllTimeAvg) / 1000;
501
+ this.FinalSpeed;
502
+ var StartRecoding = Start;
503
+ StartRecoding = duration - StartRecoding;
504
+ if (this.timeNow >= StartRecoding) {
505
+ if (Livespeed > 0) {
506
+ this.SpeedSamples.push(Livespeed);
507
+ }
508
+ Self.FinalSpeed = Self.ArraySum(Self.SpeedSamples) / Self.SpeedSamples.length;
509
+ }
510
+ return Self.FinalSpeed;
511
+ };
512
+ openSpeedtestGet.prototype.uRandom = function(size, callback) {
513
+ var size = size;
514
+ var randomValue = new Uint32Array(262144);
515
+ function getRandom() {
516
+ var n = randomValue.length;
517
+ for (var i = 0; i < n; i++) {
518
+ randomValue[i] = Math.random() * 4294967296;
519
+ }
520
+ return randomValue;
521
+ }
522
+ var randomData = [];
523
+ var genData = function(dataSize) {
524
+ var dataSize = dataSize;
525
+ for (var i = 0; i < dataSize; i++) {
526
+ randomData[i] = getRandom();
527
+ }
528
+ return randomData;
529
+ };
530
+ return new Blob(genData(size), {type:"application/octet-stream"}, Callback(callback));
531
+ };
532
+ openSpeedtestGet.prototype.addEvt = function(o, e, f) {
533
+ o.addEventListener(e, f);
534
+ };
535
+ openSpeedtestGet.prototype.remEvt = function(o, e, f) {
536
+ o.removeEventListener(e, f);
537
+ };
538
+ var openSpeedtestEngine = function() {
539
+ var Get = new openSpeedtestGet();
540
+ var Show = new openSpeedtestShow();
541
+ Show.app();
542
+ var SendData;
543
+ var myhostName = location.hostname;
544
+ var key;
545
+ var TestServerip;
546
+ var downloadSpeed;
547
+ var uploadSpeed;
548
+ var dataUsedfordl;
549
+ var dataUsedforul;
550
+ var pingEstimate;
551
+ var jitterEstimate;
552
+ var logData;
553
+ var return_data;
554
+ var ReQ = [];
555
+ var StartTime = [];
556
+ var CurrentTime = [];
557
+ var LiveSpeedArr;
558
+ var dLoaded = 0;
559
+ var uLoaded = 0;
560
+ var currentSpeed = 0;
561
+ var uploadTimeing;
562
+ var downloadTimeing;
563
+ var downloadTime;
564
+ var uploadTime;
565
+ var saveTestData;
566
+ var stop = 0;
567
+ function reSett() {
568
+ StartTime = 0;
569
+ CurrentTime = 0;
570
+ LiveSpeedArr = 0;
571
+ currentSpeed = 0;
572
+ }
573
+ var userAgentString;
574
+ if (window.navigator.userAgent) {
575
+ userAgentString = window.navigator.userAgent;
576
+ } else {
577
+ userAgentString = "Not Found";
578
+ }
579
+ var ulFinal = ulDuration * 0.6;
580
+ var dlFinal = dlDuration * 0.6;
581
+ function setFinal() {
582
+ if (ulDuration * 0.6 >= 7) {
583
+ ulFinal = 7;
584
+ }
585
+ if (dlDuration * 0.6 >= 7) {
586
+ dlFinal = 7;
587
+ }
588
+ }
589
+ setFinal();
590
+ var launch = true;
591
+ var init = true;
592
+ Get.addEvt(Show.settingsMob.el, "click", ShowIP);
593
+ Get.addEvt(Show.settingsDesk.el, "click", ShowIP);
594
+ Get.addEvt(Show.startButtonDesk.el, "click", runTasks);
595
+ Get.addEvt(Show.startButtonMob.el, "click", runTasks);
596
+ Get.addEvt(document, "keypress", hiEnter);
597
+ var addEvent = true;
598
+ var getParams = function(url) {
599
+ var params = {};
600
+ var parser = document.createElement("a");
601
+ parser.href = url;
602
+ var query = parser.search.substring(1);
603
+ var vars = query.split("&");
604
+ for (var i = 0; i < vars.length; i++) {
605
+ var pair = vars[i].split("=");
606
+ params[pair[0]] = decodeURIComponent(pair[1]);
607
+ }
608
+ return params;
609
+ };
610
+ var getCommand = getParams(window.location.href.toLowerCase());
611
+ if (setPingSamples) {
612
+ if (typeof getCommand.ping === "string" || typeof getCommand.p === "string") {
613
+ var setPing;
614
+ if (typeof getCommand.ping !== "undefined") {
615
+ setPing = getCommand.ping;
616
+ } else if (typeof getCommand.p !== "undefined") {
617
+ setPing = getCommand.p;
618
+ }
619
+ if (setPing > 0) {
620
+ pingSamples = setPing;
621
+ pingSamples = setPing;
622
+ }
623
+ }
624
+ }
625
+ if (setPingTimeout) {
626
+ if (typeof getCommand.out === "string" || typeof getCommand.o === "string") {
627
+ var setOut;
628
+ if (typeof getCommand.out !== "undefined") {
629
+ setOut = getCommand.out;
630
+ } else if (typeof getCommand.o !== "undefined") {
631
+ setOut = getCommand.o;
632
+ }
633
+ if (setOut > 1) {
634
+ pingTimeOut = setOut;
635
+ pingTimeOut = setOut;
636
+ }
637
+ }
638
+ }
639
+ if (setHTTPReq) {
640
+ if (typeof getCommand.xhr === "string" || typeof getCommand.x === "string") {
641
+ var setThreads;
642
+ if (typeof getCommand.xhr !== "undefined") {
643
+ setThreads = getCommand.xhr;
644
+ } else if (typeof getCommand.x !== "undefined") {
645
+ setThreads = getCommand.x;
646
+ }
647
+ if (setThreads > 0 && setThreads <= 32) {
648
+ dlThreads = setThreads;
649
+ ulThreads = setThreads;
650
+ }
651
+ }
652
+ }
653
+ function isValidHttpUrl(str) {
654
+ var regex = /(?:https?):\/\/(\w+:?\w*)?(\S+)(:\d+)?(\/|\/([\w#!:.?+=&%!\-\/]))?/;
655
+ if (!regex.test(str)) {
656
+ return false;
657
+ } else {
658
+ return true;
659
+ }
660
+ }
661
+ if (selectServer) {
662
+ if (typeof getCommand.host === "string" || typeof getCommand.h === "string") {
663
+ var severAddress;
664
+ if (typeof getCommand.host !== "undefined") {
665
+ severAddress = getCommand.host;
666
+ } else if (typeof getCommand.h !== "undefined") {
667
+ severAddress = getCommand.h;
668
+ }
669
+ if (isValidHttpUrl(severAddress)) {
670
+ openSpeedTestServerList = [{ServerName:"Home", Download:severAddress + "/downloading", Upload:severAddress + "/upload", ServerIcon:"DefaultIcon",},];
671
+ }
672
+ }
673
+ }
674
+ var custom = parseInt(getCommand.stress);
675
+ var customS = parseInt(getCommand.s);
676
+ var runStress;
677
+ var runStressCustom;
678
+ if (typeof getCommand.stress === "string") {
679
+ runStress = getCommand.stress;
680
+ runStressCustom = custom;
681
+ } else if (typeof getCommand.s === "string") {
682
+ runStress = getCommand.s;
683
+ runStressCustom = customS;
684
+ }
685
+ if (runStress && stressTest) {
686
+ if (runStress === "low" || runStress === "l") {
687
+ dlDuration = 300;
688
+ ulDuration = 300;
689
+ }
690
+ if (runStress === "medium" || runStress === "m") {
691
+ dlDuration = 600;
692
+ ulDuration = 600;
693
+ }
694
+ if (runStress === "high" || runStress === "h") {
695
+ dlDuration = 900;
696
+ ulDuration = 900;
697
+ }
698
+ if (runStress === "veryhigh" || runStress === "v") {
699
+ dlDuration = 1800;
700
+ ulDuration = 1800;
701
+ }
702
+ if (runStress === "extreme" || runStress === "e") {
703
+ dlDuration = 3600;
704
+ ulDuration = 3600;
705
+ }
706
+ if (runStress === "day" || runStress === "d") {
707
+ dlDuration = 86400;
708
+ ulDuration = 86400;
709
+ }
710
+ if (runStress === "year" || runStress === "y") {
711
+ dlDuration = 31557600;
712
+ ulDuration = 31557600;
713
+ }
714
+ if (custom > 12 || customS > 12) {
715
+ dlDuration = runStressCustom;
716
+ ulDuration = runStressCustom;
717
+ }
718
+ }
719
+ var overheadClean = parseInt(getCommand.clean);
720
+ var overheadCleanC = parseInt(getCommand.c);
721
+ var customOverHeadValue = 1;
722
+ if (overheadClean) {
723
+ customOverHeadValue = overheadClean;
724
+ } else if (overheadCleanC) {
725
+ customOverHeadValue = overheadCleanC;
726
+ }
727
+ if (enableClean) {
728
+ if (typeof getCommand.clean === "string" || typeof getCommand.c === "string") {
729
+ if (overheadClean >= 1 || overheadCleanC >= 1) {
730
+ if (overheadClean < 5 || overheadCleanC < 5) {
731
+ upAdjust = 1 + customOverHeadValue / 100;
732
+ dlAdjust = 1 + customOverHeadValue / 100;
733
+ }
734
+ } else {
735
+ upAdjust = 1;
736
+ dlAdjust = 1;
737
+ }
738
+ }
739
+ }
740
+ var OpenSpeedTestRun = parseInt(getCommand.run);
741
+ var OpenSpeedTestRunR = parseInt(getCommand.r);
742
+ var OpenSpeedTestStart;
743
+ if (enableRun) {
744
+ if (typeof getCommand.run === "string" || typeof getCommand.r === "string") {
745
+ if (OpenSpeedTestRun > 0) {
746
+ OpenSpeedTestStart = OpenSpeedTestRun;
747
+ } else if (OpenSpeedTestRunR > 0) {
748
+ OpenSpeedTestStart = OpenSpeedTestRunR;
749
+ } else {
750
+ OpenSpeedTestStart = 0;
751
+ }
752
+ }
753
+ }
754
+ if (OpenSpeedTestStart >= 0) {
755
+ if (launch) {
756
+ runTasks();
757
+ }
758
+ }
759
+ var runTest = getCommand.test;
760
+ var runTestT = getCommand.t;
761
+ var SelectTest = false;
762
+ if (selectTest) {
763
+ if (typeof runTest === "string" || typeof runTestT === "string") {
764
+ var runTestC;
765
+ if (runTest) {
766
+ runTestC = runTest;
767
+ SelectTest = runTest;
768
+ } else if (runTestT) {
769
+ runTestC = runTestT;
770
+ SelectTest = runTestT;
771
+ }
772
+ if (runTestC === "download" || runTestC === "d") {
773
+ uploadSpeed = 0;
774
+ dataUsedforul = 0;
775
+ SelectTest = "Download";
776
+ if (launch) {
777
+ runTasks();
778
+ }
779
+ } else if (runTestC === "upload" || runTestC === "u") {
780
+ downloadSpeed = 0;
781
+ dataUsedfordl = 0;
782
+ SelectTest = "Upload";
783
+ stop = 1;
784
+ if (launch) {
785
+ runTasks();
786
+ }
787
+ } else if (runTestC === "ping" || runTestC === "p") {
788
+ uploadSpeed = 0;
789
+ dataUsedforul = 0;
790
+ downloadSpeed = 0;
791
+ dataUsedfordl = 0;
792
+ SelectTest = "Ping";
793
+ if (launch) {
794
+ runTasks();
795
+ }
796
+ } else {
797
+ SelectTest = false;
798
+ }
799
+ }
800
+ }
801
+ var Startit = 0;
802
+ function removeEvts() {
803
+ Get.remEvt(Show.settingsMob.el, "click", ShowIP);
804
+ Get.remEvt(Show.settingsDesk.el, "click", ShowIP);
805
+ Get.remEvt(Show.startButtonDesk.el, "click", runTasks);
806
+ Get.remEvt(Show.startButtonMob.el, "click", runTasks);
807
+ Get.remEvt(document, "keypress", hiEnter);
808
+ }
809
+ var requestIP = false;
810
+ function ShowIP() {
811
+ if (requestIP) {
812
+ Show.YourIP.el.textContent = "Please wait..";
813
+ ServerConnect(7);
814
+ requestIP = false;
815
+ }
816
+ Show.ip();
817
+ }
818
+ function runTasks() {
819
+ if (addEvent) {
820
+ removeEvts();
821
+ addEvent = false;
822
+ }
823
+ if (OpenSpeedTestStart >= 0) {
824
+ launch = false;
825
+ Show.userInterface();
826
+ init = false;
827
+ var AutoTme = Math.ceil(Math.abs(OpenSpeedTestStart));
828
+ Show.showStatus("Automatic Test Starts in ...");
829
+ var autoTest = setInterval(countDownF, 1000);
830
+ }
831
+ function countDownF() {
832
+ if (AutoTme >= 1) {
833
+ AutoTme = AutoTme - 1;
834
+ Show.LiveSpeed(AutoTme, "countDown");
835
+ } else {
836
+ if (AutoTme <= 0) {
837
+ clearInterval(autoTest);
838
+ launch = true;
839
+ OpenSpeedTestStart = undefined;
840
+ runTasks();
841
+ }
842
+ }
843
+ }
844
+ if (openSpeedTestServerList === "fetch" && launch === true) {
845
+ launch = false;
846
+ Show.showStatus("Fetching Server Info..");
847
+ ServerConnect(6);
848
+ }
849
+ if (launch === true) {
850
+ if (SelectTest === "Ping") {
851
+ testRun();
852
+ } else if (SelectTest === "Download") {
853
+ testRun();
854
+ } else if (SelectTest === "Upload") {
855
+ testRun();
856
+ } else if (SelectTest === false) {
857
+ testRun();
858
+ }
859
+ }
860
+ }
861
+ var osttm = "\u2122";
862
+ var myname = "OpenSpeedTest";
863
+ var com = ".com";
864
+ var ost = myname + osttm;
865
+ function hiEnter(e) {
866
+ if (e.key === "Enter") {
867
+ runTasks();
868
+ }
869
+ }
870
+ var showResult = 0;
871
+ if (openChannel === "web") {
872
+ showResult = webRe;
873
+ requestIP = true;
874
+ }
875
+ if (openChannel === "widget") {
876
+ showResult = widgetRe;
877
+ requestIP = true;
878
+ }
879
+ if (openChannel === "selfwidget") {
880
+ showResult = widgetRe;
881
+ TestServerip = domainx;
882
+ myhostName = TestServerip;
883
+ }
884
+ if (openChannel === "dev") {
885
+ }
886
+ function testRun() {
887
+ if (init) {
888
+ Show.userInterface();
889
+ init = false;
890
+ }
891
+ OpenSpeedtest();
892
+ }
893
+ function OpenSpeedtest() {
894
+ if (openChannel === "widget" || openChannel === "web") {
895
+ ServerConnect(1);
896
+ }
897
+ function readyToUP() {
898
+ uploadTime = window.performance.now();
899
+ upReq();
900
+ }
901
+ var Engine = setInterval(function() {
902
+ if (Status === "Loaded") {
903
+ Status = "busy";
904
+ sendPing(0);
905
+ }
906
+ if (Status === "Ping") {
907
+ Status = "busy";
908
+ Show.showStatus("Milliseconds");
909
+ }
910
+ if (Status === "Download") {
911
+ Show.showStatus("Initializing..");
912
+ Get.reset();
913
+ reSett();
914
+ Show.reset();
915
+ downloadTime = window.performance.now();
916
+ downReq();
917
+ Status = "initDown";
918
+ }
919
+ if (Status === "Downloading") {
920
+ Show.Symbol(0);
921
+ if (Startit == 0) {
922
+ Startit = 1;
923
+ Show.showStatus("Testing download speed..");
924
+ var extraTime = (window.performance.now() - downloadTime) / 1000;
925
+ dReset = extraTime;
926
+ Show.progress(1, dlDuration + 2.5);
927
+ dlDuration += extraTime;
928
+ }
929
+ downloadTimeing = (window.performance.now() - downloadTime) / 1000;
930
+ reportCurrentSpeed("dl");
931
+ Show.showStatus("Mbps download");
932
+ Show.mainGaugeProgress(currentSpeed);
933
+ Show.LiveSpeed(currentSpeed);
934
+ Show.Graph(currentSpeed, 0);
935
+ downloadSpeed = Get.AvgSpeed(currentSpeed, dlFinal, dlDuration);
936
+ if (downloadTimeing >= dlDuration && ProG == "done") {
937
+ if (SelectTest) {
938
+ Show.GaugeProgresstoZero(currentSpeed, "SendR");
939
+ Show.showStatus("All done");
940
+ Show.Symbol(2);
941
+ } else {
942
+ Show.GaugeProgresstoZero(currentSpeed, "Upload");
943
+ }
944
+ Show.downloadResult(downloadSpeed);
945
+ dataUsedfordl = dLoaded;
946
+ stop = 1;
947
+ Status = "busy";
948
+ reSett();
949
+ Get.reset();
950
+ }
951
+ }
952
+ if (Status == "Upload") {
953
+ if (stop === 1) {
954
+ Show.Symbol(1);
955
+ Status = "initup";
956
+ Show.showStatus("Initializing..");
957
+ Show.LiveSpeed("...", "speedToZero");
958
+ SendData = Get.uRandom(ulDataSize, readyToUP);
959
+ if (SelectTest) {
960
+ Startit = 1;
961
+ }
962
+ }
963
+ }
964
+ if (Status === "Uploading") {
965
+ if (Startit == 1) {
966
+ Startit = 2;
967
+ Show.showStatus("Testing upload speed..");
968
+ currentSpeed = 0;
969
+ Get.reset();
970
+ Show.reset();
971
+ var extraUTime = (window.performance.now() - uploadTime) / 1000;
972
+ uReset = extraUTime;
973
+ Show.progress(false, ulDuration + 2.5);
974
+ ulDuration += extraUTime;
975
+ }
976
+ Show.showStatus("Mbps upload");
977
+ uploadTimeing = (window.performance.now() - uploadTime) / 1000;
978
+ reportCurrentSpeed("up");
979
+ Show.mainGaugeProgress(currentSpeed);
980
+ Show.LiveSpeed(currentSpeed);
981
+ Show.Graph(currentSpeed, 1);
982
+ uploadSpeed = Get.AvgSpeed(currentSpeed, ulFinal, ulDuration);
983
+ if (uploadTimeing >= ulDuration && stop == 1) {
984
+ dataUsedforul = uLoaded;
985
+ Show.uploadResult(uploadSpeed);
986
+ Show.GaugeProgresstoZero(currentSpeed, "SendR");
987
+ SendData = undefined;
988
+ Show.showStatus("All done");
989
+ Show.Symbol(2);
990
+ Status = "busy";
991
+ stop = 0;
992
+ }
993
+ }
994
+ if (Status === "Error") {
995
+ Show.showStatus("Check your network connection status.");
996
+ Show.ConnectionError();
997
+ Status = "busy";
998
+ clearInterval(Engine);
999
+ var dummyElement = document.createElement("div");
1000
+ dummyElement.innerHTML = '<a xlink:href="https://openspeedtest.com/FAQ.php?ref=NetworkError" style="cursor: pointer" target="_blank"></a>';
1001
+ var htmlAnchorElement = dummyElement.querySelector("a");
1002
+ Show.oDoLiveSpeed.el.textContent = "Network Error";
1003
+ var circleSVG = document.getElementById("oDoLiveSpeed");
1004
+ htmlAnchorElement.innerHTML = circleSVG.innerHTML;
1005
+ circleSVG.innerHTML = dummyElement.innerHTML;
1006
+ }
1007
+ if (Status === "SendR") {
1008
+ Show.showStatus("All done");
1009
+ var dummyElement = document.createElement("div");
1010
+ dummyElement.innerHTML = '<a xlink:href="https://openspeedtest.com?ref=Self-Hosted-Outro&run=5" style="cursor: pointer" target="_blank"></a>';
1011
+ var htmlAnchorElement = dummyElement.querySelector("a");
1012
+ Show.oDoLiveSpeed.el.textContent = ost;
1013
+ var circleSVG = document.getElementById("oDoLiveSpeed");
1014
+ htmlAnchorElement.innerHTML = circleSVG.innerHTML;
1015
+ circleSVG.innerHTML = dummyElement.innerHTML;
1016
+ if (location.hostname != myname.toLowerCase() + com) {
1017
+ saveTestData = "https://" + myname.toLowerCase() + com + "/results/show.php?" + "&d=" + downloadSpeed.toFixed(3) + "&u=" + uploadSpeed.toFixed(3) + "&p=" + pingEstimate + "&j=" + jitterEstimate + "&dd=" + (dataUsedfordl / 1048576).toFixed(3) + "&ud=" + (dataUsedforul / 1048576).toFixed(3) + "&ua=" + userAgentString;
1018
+ saveTestData = encodeURI(saveTestData);
1019
+ var circleSVG2 = document.getElementById("resultsData");
1020
+ circleSVG2.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:href", saveTestData);
1021
+ circleSVG2.setAttribute("target", "_blank");
1022
+ if (saveData) {
1023
+ ServerConnect(5);
1024
+ }
1025
+ } else {
1026
+ ServerConnect(3);
1027
+ }
1028
+ Status = "busy";
1029
+ clearInterval(Engine);
1030
+ }
1031
+ }, 100);
1032
+ }
1033
+ function downReq() {
1034
+ for (var i = 0; i < dlThreads; i++) {
1035
+ setTimeout(function(i) {
1036
+ SendReQ(i);
1037
+ }, dlDelay * i, i);
1038
+ }
1039
+ }
1040
+ function upReq() {
1041
+ for (var i = 0; i < ulThreads; i++) {
1042
+ setTimeout(function(i) {
1043
+ SendUpReq(i);
1044
+ }, ulDelay * i, i);
1045
+ }
1046
+ }
1047
+ var dLoad = 0;
1048
+ var dDiff = 0;
1049
+ var dTotal = 0;
1050
+ var dtLoad = 0;
1051
+ var dtDiff = 0;
1052
+ var dtTotal = 0;
1053
+ var dRest = 0;
1054
+ var dReset;
1055
+ var uReset;
1056
+ var uLoad = 0;
1057
+ var uDiff = 0;
1058
+ var uTotal = 0;
1059
+ var utLoad = 0;
1060
+ var utDiff = 0;
1061
+ var utTotal = 0;
1062
+ var uRest = 0;
1063
+ var dualReset;
1064
+ var neXT = dlDuration * 1000 - 6000;
1065
+ var dualupReset;
1066
+ var neXTUp = ulDuration * 1000 - 6000;
1067
+ function reportCurrentSpeed(now) {
1068
+ if (now === "dl") {
1069
+ var dTime = downloadTimeing * 1000;
1070
+ if (dTime > dReset * 1000 + dlFinal / 2 * 1000 && dRest === 0) {
1071
+ dRest = 1;
1072
+ dtTotal = dtTotal * 0.01;
1073
+ dTotal = dTotal * 0.01;
1074
+ dualReset = dTime + 10000;
1075
+ }
1076
+ if (dTime >= dualReset && dualReset < neXT) {
1077
+ dualReset += 10000;
1078
+ dtTotal = dtTotal * 0.01;
1079
+ dTotal = dTotal * 0.01;
1080
+ }
1081
+ dLoad = dLoaded <= 0 ? 0 : dLoaded - dDiff;
1082
+ dDiff = dLoaded;
1083
+ dTotal += dLoad;
1084
+ dtLoad = dtDiff = 0 ? 0 : dTime - dtDiff;
1085
+ dtDiff = dTime;
1086
+ dtTotal += dtLoad;
1087
+ if (dTotal > 0) {
1088
+ LiveSpeedArr = dTotal / dtTotal / 125 * upAdjust;
1089
+ currentSpeed = LiveSpeedArr;
1090
+ }
1091
+ }
1092
+ if (now === "up") {
1093
+ var Tym = uploadTimeing * 1000;
1094
+ if (Tym > uReset * 1000 + ulFinal / 2 * 1000 && uRest === 0) {
1095
+ uRest = 1;
1096
+ utTotal = utTotal * 0.1;
1097
+ uTotal = uTotal * 0.1;
1098
+ dualupReset = Tym + 10000;
1099
+ }
1100
+ if (Tym >= dualupReset && dualupReset < neXTUp) {
1101
+ dualupReset += 10000;
1102
+ utTotal = utTotal * 0.1;
1103
+ uTotal = uTotal * 0.1;
1104
+ }
1105
+ uLoad = uLoaded <= 0 ? 0 : uLoaded - uDiff;
1106
+ uDiff = uLoaded;
1107
+ uTotal += uLoad;
1108
+ utLoad = utDiff = 0 ? 0 : Tym - utDiff;
1109
+ utDiff = Tym;
1110
+ utTotal += utLoad;
1111
+ if (uTotal > 0) {
1112
+ LiveSpeedArr = uTotal / utTotal / 125 * upAdjust;
1113
+ currentSpeed = LiveSpeedArr;
1114
+ }
1115
+ }
1116
+ }
1117
+ function SendReQ(i) {
1118
+ var lastLoaded = 0;
1119
+ var OST = new XMLHttpRequest();
1120
+ ReQ[i] = OST;
1121
+ ReQ[i].open("GET", fianlPingServer.Download + "?n=" + Math.random(), true);
1122
+ ReQ[i].onprogress = function(e) {
1123
+ if (stop === 1) {
1124
+ ReQ[i].abort();
1125
+ ReQ[i] = null;
1126
+ ReQ[i] = undefined;
1127
+ delete ReQ[i];
1128
+ return false;
1129
+ }
1130
+ if (Status == "initDown") {
1131
+ Status = "Downloading";
1132
+ }
1133
+ var eLoaded = e.loaded <= 0 ? 0 : e.loaded - lastLoaded;
1134
+ if (isNaN(eLoaded) || !isFinite(eLoaded) || eLoaded < 0) {
1135
+ return false;
1136
+ }
1137
+ dLoaded += eLoaded;
1138
+ lastLoaded = e.loaded;
1139
+ };
1140
+ ReQ[i].onload = function(e) {
1141
+ if (lastLoaded === 0) {
1142
+ dLoaded += e.total;
1143
+ }
1144
+ if (Status == "initDown") {
1145
+ Status = "Downloading";
1146
+ }
1147
+ if (ReQ[i]) {
1148
+ ReQ[i].abort();
1149
+ ReQ[i] = null;
1150
+ ReQ[i] = undefined;
1151
+ delete ReQ[i];
1152
+ }
1153
+ if (stop === 0) {
1154
+ SendReQ(i);
1155
+ }
1156
+ };
1157
+ ReQ[i].onerror = function(e) {
1158
+ if (stop === 0) {
1159
+ SendReQ(i);
1160
+ }
1161
+ };
1162
+ ReQ[i].responseType = "arraybuffer";
1163
+ ReQ[i].send();
1164
+ }
1165
+ var uReQ = [];
1166
+ function SendUpReq(i) {
1167
+ var lastULoaded = 0;
1168
+ var OST = new XMLHttpRequest();
1169
+ uReQ[i] = OST;
1170
+ uReQ[i].open("POST", fianlPingServer.Upload + "?n=" + Math.random(), true);
1171
+ uReQ[i].upload.onprogress = function(e) {
1172
+ if (Status == "initup" && some === undefined) {
1173
+ var some;
1174
+ Status = "Uploading";
1175
+ }
1176
+ if (uploadTimeing >= ulDuration) {
1177
+ uReQ[i].abort();
1178
+ uReQ[i] = null;
1179
+ uReQ[i] = undefined;
1180
+ delete uReQ[i];
1181
+ return false;
1182
+ }
1183
+ var eLoaded = e.loaded <= 0 ? 0 : e.loaded - lastULoaded;
1184
+ if (isNaN(eLoaded) || !isFinite(eLoaded) || eLoaded < 0) {
1185
+ return false;
1186
+ }
1187
+ uLoaded += eLoaded;
1188
+ lastULoaded = e.loaded;
1189
+ };
1190
+ uReQ[i].onload = function() {
1191
+ if (lastULoaded === 0) {
1192
+ uLoaded += ulDataSize * 1048576;
1193
+ if (uploadTimeing >= ulDuration) {
1194
+ uReQ[i].abort();
1195
+ uReQ[i] = null;
1196
+ uReQ[i] = undefined;
1197
+ delete uReQ[i];
1198
+ return false;
1199
+ }
1200
+ }
1201
+ if (Status == "initup" && some === undefined) {
1202
+ var some;
1203
+ Status = "Uploading";
1204
+ }
1205
+ if (uReQ[i]) {
1206
+ uReQ[i].abort();
1207
+ uReQ[i] = null;
1208
+ uReQ[i] = undefined;
1209
+ delete uReQ[i];
1210
+ }
1211
+ if (stop === 1) {
1212
+ SendUpReq(i);
1213
+ }
1214
+ };
1215
+ uReQ[i].onerror = function(e) {
1216
+ if (uploadTimeing <= ulDuration) {
1217
+ SendUpReq(i);
1218
+ }
1219
+ };
1220
+ uReQ[i].setRequestHeader("Content-Type", "application/octet-stream");
1221
+ if (i > 0 && uLoaded <= 17000) {
1222
+ } else {
1223
+ uReQ[i].send(SendData);
1224
+ }
1225
+ }
1226
+ function sendPing() {
1227
+ readServerList();
1228
+ }
1229
+ var fianlPingServer;
1230
+ var statusPing;
1231
+ var statusPingFinal;
1232
+ var statusJitter;
1233
+ var statusJitterFinal;
1234
+ var statusPingTest;
1235
+ var pingSendStatus = -1;
1236
+ var finalPing = [];
1237
+ var pingServer = [];
1238
+ var finalJitter = [];
1239
+ var pingSendLength = openSpeedTestServerList.length;
1240
+ function readServerList() {
1241
+ pingSendLength = openSpeedTestServerList.length;
1242
+ Status = "Ping";
1243
+ performance.clearResourceTimings();
1244
+ if (pingSendStatus < pingSendLength - 1) {
1245
+ pingSendStatus++;
1246
+ if (statusPingTest != "Stop") {
1247
+ sendPingRequest(openSpeedTestServerList[pingSendStatus], readServerList);
1248
+ }
1249
+ } else {
1250
+ if (pingServer.length >= 1) {
1251
+ var finalLeastPingResult = Math.min.apply(Math, finalPing);
1252
+ var finalLeastPingResultIndex = finalPing.indexOf(finalLeastPingResult);
1253
+ fianlPingServer = pingServer[finalLeastPingResultIndex];
1254
+ statusPingFinal = finalLeastPingResult;
1255
+ statusJitterFinal = finalJitter[finalLeastPingResultIndex];
1256
+ statusPingTest = "Busy";
1257
+ Show.LiveSpeed(statusPingFinal, "Ping");
1258
+ Show.pingResults(statusPingFinal, "Ping");
1259
+ Show.jitterResult(statusJitterFinal, "Jitter");
1260
+ pingEstimate = statusPingFinal;
1261
+ jitterEstimate = statusJitterFinal;
1262
+ if (SelectTest) {
1263
+ if (SelectTest == "Ping") {
1264
+ Status = "SendR";
1265
+ } else {
1266
+ Status = SelectTest;
1267
+ }
1268
+ } else {
1269
+ Status = "Download";
1270
+ }
1271
+ } else {
1272
+ if (pingServer.Download) {
1273
+ } else {
1274
+ Status = "Error";
1275
+ }
1276
+ }
1277
+ }
1278
+ }
1279
+ function sendPingRequest(serverListElm, callback) {
1280
+ var pingSamplesSend = 0;
1281
+ var pingResult = [];
1282
+ var jitterResult = [];
1283
+ function sendNewPingReq() {
1284
+ if (pingSamplesSend < pingSamples) {
1285
+ pingSamplesSend++;
1286
+ if (statusPingTest != "Stop") {
1287
+ PingRequest();
1288
+ }
1289
+ } else {
1290
+ if (pingResult.length > 1) {
1291
+ jitterResult.sort(function(a, b) {
1292
+ return a - b;
1293
+ });
1294
+ jitterResult = jitterResult.slice(0, jitterResult.length * jitterFinalSample);
1295
+ jitterResult = jitterResult.reduce(function(acc, val) {
1296
+ return acc + val;
1297
+ }, 0) / jitterResult.length;
1298
+ var leastJitter = jitterResult.toFixed(1);
1299
+ var leastPing = Math.min.apply(Math, pingResult);
1300
+ finalPing.push(leastPing);
1301
+ pingServer.push(serverListElm);
1302
+ finalJitter.push(leastJitter);
1303
+ if (typeof callback === "function") {
1304
+ callback();
1305
+ }
1306
+ } else {
1307
+ if (typeof callback === "function") {
1308
+ callback();
1309
+ }
1310
+ }
1311
+ }
1312
+ }
1313
+ function PingRequest() {
1314
+ var OST = new XMLHttpRequest();
1315
+ var ReQ = OST;
1316
+ if (statusPingTest != "Stop") {
1317
+ ReQ.abort();
1318
+ }
1319
+ ReQ.open(pingMethod, serverListElm[pingFile] + "?n=" + Math.random(), true);
1320
+ ReQ.timeout = pingTimeOut;
1321
+ var startTime = window.performance.now();
1322
+ ReQ.send();
1323
+ ReQ.onload = function() {
1324
+ if (this.status === 200 && this.readyState === 4) {
1325
+ var endTime = Math.floor(window.performance.now() - startTime);
1326
+ var perfNum = performance.getEntries();
1327
+ perfNum = perfNum[perfNum.length - 1];
1328
+ var perfPing;
1329
+ if (perfNum.initiatorType === "xmlhttprequest") {
1330
+ perfPing = parseFloat(perfNum.duration.toFixed(1));
1331
+ } else {
1332
+ perfPing = endTime;
1333
+ }
1334
+ if (pingSamplesSend > 250) {
1335
+ perfPing = endTime;
1336
+ }
1337
+ if (perfPing <= 0) {
1338
+ statusPing = 0.1;
1339
+ pingResult.push(0.1);
1340
+ } else {
1341
+ statusPing = perfPing;
1342
+ pingResult.push(perfPing);
1343
+ }
1344
+ if (pingResult.length > 1) {
1345
+ var jitterCalc = Math.abs(pingResult[pingResult.length - 1] - pingResult[pingResult.length - 2]).toFixed(1);
1346
+ jitterResult.push(parseFloat(jitterCalc));
1347
+ statusJitter = jitterCalc;
1348
+ Show.LiveSpeed(perfPing, "Ping");
1349
+ Show.pingResults(perfPing, "Ping");
1350
+ Show.jitterResult(jitterCalc, "Jitter");
1351
+ }
1352
+ sendNewPingReq();
1353
+ }
1354
+ if (this.status === 404 && this.readyState === 4) {
1355
+ pingSamplesSend++;
1356
+ sendNewPingReq();
1357
+ }
1358
+ };
1359
+ ReQ.onerror = function(e) {
1360
+ pingSamplesSend++;
1361
+ sendNewPingReq();
1362
+ };
1363
+ ReQ.ontimeout = function(e) {
1364
+ pingSamplesSend++;
1365
+ sendNewPingReq();
1366
+ };
1367
+ }
1368
+ PingRequest();
1369
+ }
1370
+ var ServerConnect = function(auth) {
1371
+ var Self = this;
1372
+ var xhr = new XMLHttpRequest();
1373
+ var url = OpenSpeedTestdb;
1374
+ if (auth == 1) {
1375
+ url = webIP;
1376
+ }
1377
+ if (auth == 5) {
1378
+ url = saveDataURL;
1379
+ }
1380
+ if (auth == 7) {
1381
+ url = get_IP;
1382
+ }
1383
+ xhr.open("POST", url, true);
1384
+ xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
1385
+ xhr.onreadystatechange = function() {
1386
+ if (xhr.readyState == 4 && xhr.status == 200) {
1387
+ return_data = xhr.responseText.trim();
1388
+ if (auth == 2) {
1389
+ key = return_data;
1390
+ }
1391
+ if (auth == 1) {
1392
+ TestServerip = return_data;
1393
+ }
1394
+ if (auth == 3) {
1395
+ setTimeout(function() {
1396
+ location.href = showResult + return_data;
1397
+ }, 1500);
1398
+ }
1399
+ if (auth == 6) {
1400
+ openSpeedTestServerList = JSON.parse(return_data);
1401
+ launch = true;
1402
+ runTasks();
1403
+ }
1404
+ if (auth == 7) {
1405
+ Show.YourIP.el.textContent = return_data;
1406
+ }
1407
+ }
1408
+ };
1409
+ if (auth == 2) {
1410
+ logData = "r=n";
1411
+ }
1412
+ if (auth == 3) {
1413
+ logData = "r=l" + "&d=" + downloadSpeed + "&u=" + uploadSpeed + "&dd=" + dataUsedfordl / 1048576 + "&ud=" + dataUsedforul / 1048576 + "&p=" + pingEstimate + "&do=" + myhostName + "&S=" + key + "&sip=" + TestServerip + "&jit=" + jitterEstimate + "&ua=" + userAgentString;
1414
+ }
1415
+ if (auth == 5) {
1416
+ logData = saveTestData;
1417
+ }
1418
+ if (auth == 6) {
1419
+ logData = "r=s";
1420
+ }
1421
+ xhr.send(logData);
1422
+ };
1423
+ };
1424
+ OpenSpeedTest.Start = function() {
1425
+ new openSpeedtestEngine();
1426
+ };
1427
+ })(window.OpenSpeedTest = window.OpenSpeedTest || {});
files/www/assets/js/app-2.5.4.min.js ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Official Website : https://OpenSpeedTest.COM | Email: support@openspeedtest.com
3
+ Developed by : Vishnu | https://Vishnu.Pro | Email : me@vishnu.pro
4
+ Like this Project? Please Donate NOW & Keep us Alive -> https://go.openspeedtest.com/Donate
5
+ Speed Test by OpenSpeedTest™️ is Free and Open-Source Software (FOSS) with MIT License.
6
+ Read full license terms @ http://go.openspeedtest.com/License
7
+ If you have any Questions, ideas or Comments Please Send it via -> https://go.openspeedtest.com/SendMessage
8
+ */
9
+ window.onload=function(){var X=document.getElementById("OpenSpeedTest-UI");X.parentNode.replaceChild(X.contentDocument.documentElement,X);ostOnload();OpenSpeedTest.Start()};
10
+ (function(X){function h(c){if(!(this instanceof h))return new h(c);this.el=document.getElementById(c)}var m,Ma,Na=function(c){c&&"function"===typeof c&&c()};h.prototype.fade=function(c,d,a){var f="in"===c,t=f?0:1,w=14/d,n=this;f&&(n.el.style.display="block",n.el.style.opacity=t);var q=window.setInterval(function(){t=f?t+w:t-w;n.el.style.opacity=t;0>=t&&(n.el.style.display="none");(0>=t||1<=t)&&window.clearInterval(q,Na(a))},14)};var Oa=function(c,d,a,f){c/=f;c--;return a*(c*c*c+1)+d},r=function(){this.YourIP=
11
+ h("YourIP");this.ipDesk=h("ipDesk");this.ipMob=h("ipMob");this.downSymbolDesk=h("downSymbolDesk");this.upSymbolDesk=h("upSymbolDesk");this.upSymbolMob=h("upSymbolMob");this.downSymbolMob=h("downSymbolMob");this.settingsMob=h("settingsMob");this.settingsDesk=h("settingsDesk");this.oDoLiveStatus=h("oDoLiveStatus");this.ConnectErrorMob=h("ConnectErrorMob");this.ConnectErrorDesk=h("ConnectErrorDesk");this.downResult=h("downResult");this.upRestxt=h("upRestxt");this.pingResult=h("pingResult");this.jitterDesk=
12
+ h("jitterDesk");this.pingMobres=h("pingMobres");this.JitterResultMon=h("JitterResultMon");this.JitterResultms=h("JitterResultms");this.UI_Desk=h("UI-Desk");this.UI_Mob=h("UI-Mob");this.oDoTopSpeed=h("oDoTopSpeed");this.startButtonMob=h("startButtonMob");this.startButtonDesk=h("startButtonDesk");this.intro_Desk=h("intro-Desk");this.intro_Mob=h("intro-Mob");this.loader=h("loading_app");this.OpenSpeedtest=h("OpenSpeedtest");this.mainGaugebg_Desk=h("mainGaugebg-Desk");this.mainGaugeBlue_Desk=h("mainGaugeBlue-Desk");
13
+ this.mainGaugeWhite_Desk=h("mainGaugeWhite-Desk");this.mainGaugebg_Mob=h("mainGaugebg-Mob");this.mainGaugeBlue_Mob=h("mainGaugeBlue-Mob");this.mainGaugeWhite_Mob=h("mainGaugeWhite-Mob");this.oDoLiveSpeed=h("oDoLiveSpeed");this.progressStatus_Mob=h("progressStatus-Mob");this.progressStatus_Desk=h("progressStatus-Desk");this.graphc1=h("graphc1");this.graphc2=h("graphc2");this.graphMob2=h("graphMob2");this.graphMob1=h("graphMob1");this.text=h("text");this.scale=[{degree:680,value:0},{degree:570,value:.5},
14
+ {degree:460,value:1},{degree:337,value:10},{degree:220,value:100},{degree:115,value:500},{degree:0,value:1E3}];this.polygon=this.chart=this.element="";this.width=200;this.height=50;this.maxValue=0;this.values=[];this.points=[];this.vSteps=5;this.measurements=[];this.points=[]};r.prototype.reset=function(){this.polygon=this.chart=this.element="";this.width=200;this.height=50;this.maxValue=0;this.values=[];this.points=[];this.vSteps=5;this.measurements=[];this.points=[]};r.prototype.ip=function(){"block"===
15
+ this.ipDesk.el.style.display?(this.ipDesk.el.style.display="none",this.ipMob.el.style.display="none"):(this.ipDesk.el.style.display="block",this.ipMob.el.style.display="block")};r.prototype.prePing=function(){this.loader.fade("out",500);this.OpenSpeedtest.fade("in",1E3)};r.prototype.app=function(){this.loader.fade("out",500,this.ShowAppIntro())};r.prototype.ShowAppIntro=function(){this.OpenSpeedtest.fade("in",1E3)};r.prototype.userInterface=function(){this.intro_Desk.fade("out",1E3);this.intro_Mob.fade("out",
16
+ 1E3,this.ShowUI())};r.prototype.ShowUI=function(){this.UI_Desk.fade("in",1E3);this.UI_Mob.fade("in",1E3,function(c){m="Loaded";console.log("Developed by Vishnu. Email --\x3e me@vishnu.pro")})};r.prototype.Symbol=function(c){0==c&&(this.downSymbolMob.el.style.display="block",this.downSymbolDesk.el.style.display="block",this.upSymbolMob.el.style.display="none",this.upSymbolDesk.el.style.display="none");1==c&&(this.downSymbolMob.el.style.display="none",this.downSymbolDesk.el.style.display="none",this.upSymbolMob.el.style.display=
17
+ "block",this.upSymbolDesk.el.style.display="block");2==c&&(this.downSymbolMob.el.style.display="none",this.downSymbolDesk.el.style.display="none",this.upSymbolMob.el.style.display="none",this.upSymbolDesk.el.style.display="none")};r.prototype.Graph=function(c,d){function a(q,M){for(n=f.maxValue=0;n<f.values.length;n++)f.values[n]>f.maxValue&&(f.maxValue=f.values[n]);f.maxValue=Math.ceil(f.maxValue);if(1<f.values.length){var F="0,"+f.height+" ";for(n=0;n<f.values.length;n++){var Q=f.values[n]/f.maxValue;
18
+ Q=(130/(f.values.length-1)*n).toFixed(2)+","+(f.height-f.height*Q).toFixed(2)+" ";F+=Q}F+="130,"+f.height;f.points=F}for(n=0;n<f.vSteps;n++)f.measurements.push(Math.ceil(f.maxValue/f.vSteps*(n+1)));f.measurements.reverse();for(F=document.getElementsByClassName(w);0<F.length;)F[0].remove();f.polygon=document.createElementNS("http://www.w3.org/2000/svg","polygon");f.polygon.setAttribute("points",f.points);f.polygon.setAttribute("class",w);1<f.values.length&&t.appendChild(f.polygon)}"remove"in Element.prototype||
19
+ (Element.prototype.remove=function(){this.parentNode&&this.parentNode.removeChild(this)});var f=this;if(0===d){var t=this.graphc1.el;var w="line";this.graphMob2.el.style.display="none";this.graphMob1.el.style.display="block"}else t=this.graphc2.el,w="line2",this.graphMob1.el.style.display="none",this.graphMob2.el.style.display="block";isNaN(c)?this.values.push(""):this.values.push(c);var n;0<c&&a(t,c)};r.prototype.progress=function(c,d){var a=this,f=Date.now(),t=setInterval(function(){var w=(Date.now()-
20
+ f)/1E3,n=Oa(w,400,400,d),q=Oa(w,400,-400,d);c?(a.progressStatus_Desk.el.style.strokeDashoffset=n,a.progressStatus_Mob.el.style.strokeDashoffset=n):(a.progressStatus_Desk.el.style.strokeDashoffset=q,a.progressStatus_Mob.el.style.strokeDashoffset=q);w>=d&&(clearInterval(t),Ma="done",a.progressStatus_Desk.el.style.strokeDashoffset=800,a.progressStatus_Mob.el.style.strokeDashoffset=800)},14)};r.prototype.mainGaugeProgress=function(c){var d=c;0>d&&(d=0);var a=this.getNonlinearDegree(d);0<c&&(this.mainGaugeBlue_Desk.el.style.strokeOpacity=
21
+ 1,this.mainGaugeWhite_Desk.el.style.strokeOpacity=1,this.mainGaugeBlue_Mob.el.style.strokeOpacity=1,this.mainGaugeWhite_Mob.el.style.strokeOpacity=1,this.mainGaugeBlue_Desk.el.style.strokeDashoffset=a,this.mainGaugeWhite_Desk.el.style.strokeDashoffset=0==a?1:a+1,this.mainGaugeBlue_Mob.el.style.strokeDashoffset=a,this.mainGaugeWhite_Mob.el.style.strokeDashoffset=0==a?1:a+1);0==a&&1E3<d?(this.mainGaugeBlue_Mob.el.style.strokeDashoffset=681<=a?681:a,this.mainGaugeWhite_Mob.el.style.strokeDashoffset=
22
+ 0==a?1:a+1,this.mainGaugeWhite_Desk.el.style.strokeDashoffset=0==a?1:a+1,this.mainGaugeBlue_Desk.el.style.strokeDashoffset=681<=a?681:a):0==a&&0>=d&&(this.mainGaugeBlue_Mob.el.style.strokeDashoffset=681.1,this.mainGaugeWhite_Mob.el.style.strokeDashoffset=.1,this.mainGaugeWhite_Desk.el.style.strokeDashoffset=.1,this.mainGaugeBlue_Desk.el.style.strokeDashoffset=681.1)};r.prototype.showStatus=function(c){this.oDoLiveStatus.el.textContent=c};r.prototype.ConnectionError=function(){this.ConnectErrorMob.el.style.display=
23
+ "block";this.ConnectErrorDesk.el.style.display="block"};r.prototype.uploadResult=function(c){1>c&&(this.upRestxt.el.textContent=c.toFixed(3));1<=c&&9999>c&&(this.upRestxt.el.textContent=c.toFixed(1));1E4<=c&&99999>c&&(this.upRestxt.el.textContent=c.toFixed(1),this.upRestxt.el.style.fontSize="20px");1E5<=c&&(this.upRestxt.el.textContent=c.toFixed(1),this.upRestxt.el.style.fontSize="18px")};r.prototype.pingResults=function(c,d){var a=c;"Ping"===d&&(1<=a&&1E4>a?(this.pingResult.el.textContent=Math.floor(a),
24
+ this.pingMobres.el.textContent=Math.floor(a)):0<=a&&1>a&&(0==a&&(a=0),this.pingResult.el.textContent=a,this.pingMobres.el.textContent=a));"Error"===d&&(this.oDoLiveSpeed.el.textContent=a)};r.prototype.downloadResult=function(c){1>c&&(this.downResult.el.textContent=c.toFixed(3));1<=c&&9999>c&&(this.downResult.el.textContent=c.toFixed(1));1E4<=c&&99999>c&&(this.downResult.el.textContent=c.toFixed(1),this.downResult.el.style.fontSize="20px");1E5<=c&&(this.downResult.el.textContent=c.toFixed(1),this.downResult.el.style.fontSize=
25
+ "18px")};r.prototype.jitterResult=function(c,d){var a=c;"Jitter"===d&&(1<=a&&1E4>a?(this.jitterDesk.el.textContent=Math.floor(a),1<=a&&100>a&&(this.JitterResultMon.el.textContent=Math.floor(a)),100<=a&&(a=(a/1E3).toFixed(1),this.JitterResultMon.el.textContent=a+"k")):0<=a&&1>a&&(0==a&&(a=0),this.jitterDesk.el.textContent=a,this.JitterResultMon.el.textContent=a))};r.prototype.LiveSpeed=function(c,d){var a=c;if("countDown"===d){var f=a.toFixed(0);this.oDoLiveSpeed.el.textContent=f}else"speedToZero"===
26
+ d?("number"==typeof a&&(a=a.toFixed(1)),0>=a&&(a=0),this.oDoLiveSpeed.el.textContent=a,this.oDoTopSpeed.el.textContent="1000+",this.oDoTopSpeed.el.style.fontSize="16.9px",this.oDoTopSpeed.el.style.fill="gray"):"Ping"===d?1<=a&&1E4>a?this.oDoLiveSpeed.el.textContent=Math.floor(a):0<=a&&1>a&&(0==a&&(a=0),this.oDoLiveSpeed.el.textContent=a):(0==a&&(f=a.toFixed(0),this.oDoLiveSpeed.el.textContent=f),1>=a&&0<a&&(f=a.toFixed(3),this.oDoLiveSpeed.el.textContent=f),1<a&&(f=a.toFixed(1),this.oDoLiveSpeed.el.textContent=
27
+ f),1E3>=a&&(this.oDoTopSpeed.el.textContent="1000+",this.oDoTopSpeed.el.style.fontSize="16.9px",this.oDoTopSpeed.el.style.fill="gray"),1010<=a&&(this.oDoTopSpeed.el.textContent=1E3*Math.floor(a/1010)+"+",this.oDoTopSpeed.el.style.fill="gray",this.oDoTopSpeed.el.style.fontSize="17.2px"))};r.prototype.GaugeProgresstoZero=function(c,d){var a=this;if(0<=c)var f=Date.now(),t=0-c,w=setInterval(function(){var n=(Date.now()-f)/1E3;var q=n/3;q--;q=t*(q*q*q*q*q+1)+c;a.LiveSpeed(q,"speedToZero");a.mainGaugeProgress(q);
28
+ if(3<=n||0>=q)clearInterval(w),a.LiveSpeed(0,"speedToZero"),a.mainGaugeProgress(0),m=d},16)};r.prototype.getNonlinearDegree=function(c){var d=0;if(0==c||0>=c||isNaN(c))return 0;for(;d<this.scale.length;)if(c>this.scale[d].value)d++;else return this.scale[d-1].degree+(c-this.scale[d-1].value)*(this.scale[d].degree-this.scale[d-1].degree)/(this.scale[d].value-this.scale[d-1].value);return this.scale[this.scale.length-1].degree};var O=function(){this.OverAllTimeAvg=window.performance.now();this.SpeedSamples=
29
+ [];this.FinalSpeed};O.prototype.reset=function(){this.OverAllTimeAvg=window.performance.now();this.SpeedSamples=[];this.FinalSpeed=0};O.prototype.ArraySum=function(c){return c?c.reduce(function(d,a){if("number"===typeof d&&"number"===typeof a)return d+a},0):0};O.prototype.AvgSpeed=function(c,d,a){this.timeNow=(window.performance.now()-this.OverAllTimeAvg)/1E3;this.FinalSpeed;this.timeNow>=a-d&&(0<c&&this.SpeedSamples.push(c),this.FinalSpeed=this.ArraySum(this.SpeedSamples)/this.SpeedSamples.length);
30
+ return this.FinalSpeed};O.prototype.uRandom=function(c,d){for(var a=new Uint32Array(262144),f=[],t=Blob,w=0;w<c;w++){for(var n=w,q=a.length,M=0;M<q;M++)a[M]=4294967296*Math.random();f[n]=a}return new t(f,{type:"application/octet-stream"},Na(d))};O.prototype.addEvt=function(c,d,a){c.addEventListener(d,a)};O.prototype.remEvt=function(c,d,a){c.removeEventListener(d,a)};var jb=function(){function c(){fa&&(e.YourIP.el.textContent="Please wait..",Y(7),fa=!1);e.ip()}function d(){function b(){1<=l?(--l,e.LiveSpeed(l,
31
+ "countDown")):0>=l&&(clearInterval(g),G=!0,Z=void 0,d())}Pa&&(x.remEvt(e.settingsMob.el,"click",c),x.remEvt(e.settingsDesk.el,"click",c),x.remEvt(e.startButtonDesk.el,"click",d),x.remEvt(e.startButtonMob.el,"click",d),x.remEvt(document,"keypress",a),Pa=!1);if(0<=Z){G=!1;e.userInterface();ua=!1;var l=Math.ceil(Math.abs(Z));e.showStatus("Automatic Test Starts in ...");var g=setInterval(b,1E3)}"fetch"===openSpeedTestServerList&&!0===G&&(G=!1,e.showStatus("Fetching Server Info.."),Y(6));!0===G&&("Ping"===
32
+ A?f():"Download"===A?f():"Upload"===A?f():!1===A&&f())}function a(b){"Enter"===b.key&&d()}function f(){ua&&(e.userInterface(),ua=!1);t()}function t(){function b(){va=window.performance.now();n()}"widget"!==openChannel&&"web"!==openChannel||Y(1);var l=setInterval(function(){"Loaded"===m&&(m="busy",Q());"Ping"===m&&(m="busy",e.showStatus("Milliseconds"));"Download"===m&&(e.showStatus("Initializing.."),x.reset(),y=ha=0,e.reset(),wa=window.performance.now(),w(),m="initDown");if("Downloading"===m){e.Symbol(0);
33
+ if(0==aa){aa=1;e.showStatus("Testing download speed..");var g=(window.performance.now()-wa)/1E3;Qa=g;e.progress(1,dlDuration+2.5);dlDuration+=g}xa=(window.performance.now()-wa)/1E3;q("dl");e.showStatus("Mbps download");e.mainGaugeProgress(y);e.LiveSpeed(y);e.Graph(y,0);R=x.AvgSpeed(y,ya,dlDuration);xa>=dlDuration&&"done"==Ma&&(A?(e.GaugeProgresstoZero(y,"SendR"),e.showStatus("All done"),e.Symbol(2)):e.GaugeProgresstoZero(y,"Upload"),e.downloadResult(R),ia=S,I=1,m="busy",y=ha=0,x.reset())}"Upload"==
34
+ m&&1===I&&(e.Symbol(1),m="initup",e.showStatus("Initializing.."),e.LiveSpeed("...","speedToZero"),za=x.uRandom(ulDataSize,b),A&&(aa=1));"Uploading"===m&&(1==aa&&(aa=2,e.showStatus("Testing upload speed.."),y=0,x.reset(),e.reset(),Ra=g=(window.performance.now()-va)/1E3,e.progress(!1,ulDuration+2.5),ulDuration+=g),e.showStatus("Mbps upload"),T=(window.performance.now()-va)/1E3,q("up"),e.mainGaugeProgress(y),e.LiveSpeed(y),e.Graph(y,1),U=x.AvgSpeed(y,Aa,ulDuration),T>=ulDuration&&1==I&&(ja=P,e.uploadResult(U),
35
+ e.GaugeProgresstoZero(y,"SendR"),za=void 0,e.showStatus("All done"),e.Symbol(2),m="busy",I=0));if("Error"===m){e.showStatus("Check your network connection status.");e.ConnectionError();m="busy";clearInterval(l);g=document.createElement("div");g.innerHTML='<a xlink:href="https://openspeedtest.com/FAQ.php?ref=NetworkError" style="cursor: pointer" target="_blank"></a>';var u=g.querySelector("a");e.oDoLiveSpeed.el.textContent="Network Error";var C=document.getElementById("oDoLiveSpeed");u.innerHTML=C.innerHTML;
36
+ C.innerHTML=g.innerHTML}"SendR"===m&&(e.showStatus("All done"),g=document.createElement("div"),g.innerHTML='<a xlink:href="https://openspeedtest.com?ref=Self-Hosted-Outro&run=5" style="cursor: pointer" target="_blank"></a>',u=g.querySelector("a"),e.oDoLiveSpeed.el.textContent=fb,C=document.getElementById("oDoLiveSpeed"),u.innerHTML=C.innerHTML,C.innerHTML=g.innerHTML,location.hostname!=Ba.toLowerCase()+Sa?(ba="https://"+Ba.toLowerCase()+Sa+"/results/show.php?&d="+R.toFixed(3)+"&u="+U.toFixed(3)+"&p="+
37
+ Ca+"&j="+Da+"&dd="+(ia/1048576).toFixed(3)+"&ud="+(ja/1048576).toFixed(3)+"&ua="+Ta,ba=encodeURI(ba),g=document.getElementById("resultsData"),g.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",ba),g.setAttribute("target","_blank"),saveData&&Y(5)):Y(3),m="busy",clearInterval(l))},100)}function w(){for(var b=0;b<dlThreads;b++)setTimeout(function(l){M(l)},dlDelay*b,b)}function n(){for(var b=0;b<ulThreads;b++)setTimeout(function(l){F(l)},ulDelay*b,b)}function q(b){if("dl"===b){var l=1E3*xa;
38
+ l>1E3*Qa+ya/2*1E3&&0===Ua&&(Ua=1,ka*=.01,ca*=.01,la=l+1E4);l>=la&&la<gb&&(la+=1E4,ka*=.01,ca*=.01);Va=0>=S?0:S-Wa;Wa=S;ca+=Va;Xa=Ea=l-Ea;Ea=l;ka+=Xa;0<ca&&(y=ha=ca/ka/125*upAdjust)}"up"===b&&(b=1E3*T,b>1E3*Ra+Aa/2*1E3&&0===Ya&&(Ya=1,ma*=.1,da*=.1,na=b+1E4),b>=na&&na<hb&&(na+=1E4,ma*=.1,da*=.1),Za=0>=P?0:P-$a,$a=P,da+=Za,ab=Fa=b-Fa,Fa=b,ma+=ab,0<da&&(y=ha=da/ma/125*upAdjust))}function M(b){var l=0;z[b]=new XMLHttpRequest;z[b].open("GET",Ga.Download+"?n="+Math.random(),!0);z[b].onprogress=function(g){if(1===
39
+ I)return z[b].abort(),z[b]=null,z[b]=void 0,delete z[b],!1;"initDown"==m&&(m="Downloading");var u=0>=g.loaded?0:g.loaded-l;if(isNaN(u)||!isFinite(u)||0>u)return!1;S+=u;l=g.loaded};z[b].onload=function(g){0===l&&(S+=g.total);"initDown"==m&&(m="Downloading");z[b]&&(z[b].abort(),z[b]=null,z[b]=void 0,delete z[b]);0===I&&M(b)};z[b].onerror=function(g){0===I&&M(b)};z[b].responseType="arraybuffer";z[b].send()}function F(b){var l=0;v[b]=new XMLHttpRequest;v[b].open("POST",Ga.Upload+"?n="+Math.random(),!0);
40
+ v[b].upload.onprogress=function(g){"initup"==m&&void 0===u&&(m="Uploading");if(T>=ulDuration)return v[b].abort(),v[b]=null,v[b]=void 0,delete v[b],!1;var u=0>=g.loaded?0:g.loaded-l;if(isNaN(u)||!isFinite(u)||0>u)return!1;P+=u;l=g.loaded};v[b].onload=function(){if(0===l&&(P+=1048576*ulDataSize,T>=ulDuration))return v[b].abort(),v[b]=null,v[b]=void 0,delete v[b],!1;if("initup"==m&&void 0===g){var g;m="Uploading"}v[b]&&(v[b].abort(),v[b]=null,v[b]=void 0,delete v[b]);1===I&&F(b)};v[b].onerror=function(g){T<=
41
+ ulDuration&&F(b)};v[b].setRequestHeader("Content-Type","application/octet-stream");0<b&&17E3>=P||v[b].send(za)}function Q(){bb=openSpeedTestServerList.length;m="Ping";performance.clearResourceTimings();if(Ha<bb-1)Ha++,"Stop"!=oa&&ib(openSpeedTestServerList[Ha],Q);else if(1<=pa.length){var b=Math.min.apply(Math,Ia),l=Ia.indexOf(b);Ga=pa[l];qa=b;Ja=cb[l];oa="Busy";e.LiveSpeed(qa,"Ping");e.pingResults(qa,"Ping");e.jitterResult(Ja,"Jitter");Ca=qa;Da=Ja;m=A?"Ping"==A?"SendR":A:"Download"}else pa.Download||
42
+ (m="Error")}function ib(b,l){function g(){if(C<pingSamples)C++,"Stop"!=oa&&u();else{if(1<J.length){K.sort(function(D,B){return D-B});K=K.slice(0,K.length*jitterFinalSample);K=K.reduce(function(D,B){return D+B},0)/K.length;var L=K.toFixed(1),Ka=Math.min.apply(Math,J);Ia.push(Ka);pa.push(b);cb.push(L)}"function"===typeof l&&l()}}function u(){var L=new XMLHttpRequest;"Stop"!=oa&&L.abort();L.open(pingMethod,b[pingFile]+"?n="+Math.random(),!0);L.timeout=pingTimeOut;var Ka=window.performance.now();L.send();
43
+ L.onload=function(){if(200===this.status&&4===this.readyState){var D=Math.floor(window.performance.now()-Ka),B=performance.getEntries();B=B[B.length-1];B="xmlhttprequest"===B.initiatorType?parseFloat(B.duration.toFixed(1)):D;250<C&&(B=D);0>=B?J.push(.1):J.push(B);1<J.length&&(D=Math.abs(J[J.length-1]-J[J.length-2]).toFixed(1),K.push(parseFloat(D)),e.LiveSpeed(B,"Ping"),e.pingResults(B,"Ping"),e.jitterResult(D,"Jitter"));g()}404===this.status&&4===this.readyState&&(C++,g())};L.onerror=function(D){C++;
44
+ g()};L.ontimeout=function(D){C++;g()}}var C=0,J=[],K=[];u()}var x=new O,e=new r;e.app();var za,db=location.hostname,eb,La,R,U,Ca,Da,ea,V,z=[],ha,S=0,P=0,y=0,T,xa,wa,va,ba,I=0;var Ta=window.navigator.userAgent?window.navigator.userAgent:"Not Found";var Aa=.6*ulDuration,ya=.6*dlDuration;7<=.6*ulDuration&&(Aa=7);7<=.6*dlDuration&&(ya=7);var G=!0,ua=!0;x.addEvt(e.settingsMob.el,"click",c);x.addEvt(e.settingsDesk.el,"click",c);x.addEvt(e.startButtonDesk.el,"click",d);x.addEvt(e.startButtonMob.el,"click",
45
+ d);x.addEvt(document,"keypress",a);var Pa=!0,k=function(b){var l={},g=document.createElement("a");g.href=b;b=g.search.substring(1).split("&");for(g=0;g<b.length;g++){var u=b[g].split("=");l[u[0]]=decodeURIComponent(u[1])}return l}(window.location.href.toLowerCase());if(setPingSamples&&("string"===typeof k.ping||"string"===typeof k.p)){if("undefined"!==typeof k.ping)var E=k.ping;else"undefined"!==typeof k.p&&(E=k.p);0<E&&(pingSamples=pingSamples=E)}if(setPingTimeout&&("string"===typeof k.out||"string"===
46
+ typeof k.o)){if("undefined"!==typeof k.out)var W=k.out;else"undefined"!==typeof k.o&&(W=k.o);1<W&&(pingTimeOut=pingTimeOut=W)}if(setHTTPReq&&("string"===typeof k.xhr||"string"===typeof k.x)){if("undefined"!==typeof k.xhr)var ra=k.xhr;else"undefined"!==typeof k.x&&(ra=k.x);0<ra&&32>=ra&&(ulThreads=dlThreads=ra)}if(selectServer&&("string"===typeof k.host||"string"===typeof k.h)){if("undefined"!==typeof k.host)var sa=k.host;else"undefined"!==typeof k.h&&(sa=k.h);/(?:https?):\/\/(\w+:?\w*)?(\S+)(:\d+)?(\/|\/([\w#!:.?+=&%!\-\/]))?/.test(sa)&&
47
+ (openSpeedTestServerList=[{ServerName:"Home",Download:sa+"/downloading",Upload:sa+"/upload",ServerIcon:"DefaultIcon"}])}E=parseInt(k.stress);W=parseInt(k.s);if("string"===typeof k.stress){var p=k.stress;var H=E}else"string"===typeof k.s&&(p=k.s,H=W);if(p&&stressTest){if("low"===p||"l"===p)ulDuration=dlDuration=300;if("medium"===p||"m"===p)ulDuration=dlDuration=600;if("high"===p||"h"===p)ulDuration=dlDuration=900;if("veryhigh"===p||"v"===p)ulDuration=dlDuration=1800;if("extreme"===p||"e"===p)ulDuration=
48
+ dlDuration=3600;if("day"===p||"d"===p)ulDuration=dlDuration=86400;if("year"===p||"y"===p)ulDuration=dlDuration=31557600;if(12<E||12<W)ulDuration=dlDuration=H}p=parseInt(k.clean);H=parseInt(k.c);E=1;p?E=p:H&&(E=H);if(enableClean&&("string"===typeof k.clean||"string"===typeof k.c))if(1<=p||1<=H){if(5>p||5>H)upAdjust=1+E/100,dlAdjust=1+E/100}else dlAdjust=upAdjust=1;p=parseInt(k.run);H=parseInt(k.r);var Z;!enableRun||"string"!==typeof k.run&&"string"!==typeof k.r||(Z=0<p?p:0<H?H:0);0<=Z&&G&&d();p=k.test;
49
+ k=k.t;var A=!1;if(selectTest&&("string"===typeof p||"string"===typeof k)){var N;p?A=N=p:k&&(A=N=k);if("download"===N||"d"===N){var ja=U=0;A="Download";G&&d()}else if("upload"===N||"u"===N){var ia=R=0;A="Upload";I=1;G&&d()}else"ping"===N||"p"===N?(ia=R=ja=U=0,A="Ping",G&&d()):A=!1}var aa=0,fa=!1,Ba="OpenSpeedTest",Sa=".com",fb=Ba+"\u2122",ta=0;"web"===openChannel&&(ta=webRe,fa=!0);"widget"===openChannel&&(ta=widgetRe,fa=!0);"selfwidget"===openChannel&&(ta=widgetRe,db=La=domainx);var Va=0,Wa=0,ca=0,
50
+ Xa=0,Ea=0,ka=0,Ua=0,Qa,Ra,Za=0,$a=0,da=0,ab=0,Fa=0,ma=0,Ya=0,la,gb=1E3*dlDuration-6E3,na,hb=1E3*ulDuration-6E3,v=[],Ga,qa,Ja,oa,Ha=-1,Ia=[],pa=[],cb=[],bb=openSpeedTestServerList.length,Y=function(b){var l=new XMLHttpRequest,g=OpenSpeedTestdb;1==b&&(g=webIP);5==b&&(g=saveDataURL);7==b&&(g=get_IP);l.open("POST",g,!0);l.setRequestHeader("Content-type","application/x-www-form-urlencoded");l.onreadystatechange=function(){4==l.readyState&&200==l.status&&(V=l.responseText.trim(),2==b&&(eb=V),1==b&&(La=
51
+ V),3==b&&setTimeout(function(){location.href=ta+V},1500),6==b&&(openSpeedTestServerList=JSON.parse(V),G=!0,d()),7==b&&(e.YourIP.el.textContent=V))};2==b&&(ea="r=n");3==b&&(ea="r=l&d="+R+"&u="+U+"&dd="+ia/1048576+"&ud="+ja/1048576+"&p="+Ca+"&do="+db+"&S="+eb+"&sip="+La+"&jit="+Da+"&ua="+Ta);5==b&&(ea=ba);6==b&&(ea="r=s");l.send(ea)}};X.Start=function(){new jb}})(window.OpenSpeedTest=window.OpenSpeedTest||{});
files/www/assets/js/darkmode.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ var dayMode,nightMode,darkStyle;window.addEventListener("load",changeSkin);
2
+ function changeSkin(){dayModeMob=document.getElementById("daymode-Mob");nightModeMob=document.getElementById("nightmode-Mob");dayMode=document.getElementById("daymode");nightMode=document.getElementById("nightmode");""===getCookieValue("mode")&&(nightMode.style.display="none",nightModeMob.style.display="none",dayMode.style.display="inline-block",dayModeMob.style.display="inline-block");"dark"===getCookieValue("mode")&&setSkin("dark");"light"===getCookieValue("mode")&&setSkin("light");window.matchMedia&&
3
+ window.matchMedia("(prefers-color-scheme: dark)").matches&&""===getCookieValue("mode")&&setSkin("dark")}
4
+ function setSkin(a){"dark"===a&&(dayModeMob.style.display="none",nightModeMob.style.display="inline-block",dayMode.style.display="none",nightMode.style.display="inline-block",darkStyle=document.getElementById("darkmode"),null==darkStyle&&(document.head.innerHTML+='<link id="darkmode" rel="stylesheet" href="assets/css/darkmode.css" type="text/css"/>',createCookie("mode","dark")));"light"===a&&(nightModeMob.style.display="none",dayModeMob.style.display="inline-block",nightMode.style.display="none",
5
+ dayMode.style.display="inline-block",(darkStyle=document.getElementById("darkmode"))&&darkStyle.parentNode.removeChild(darkStyle),createCookie("mode","light"))}function toggleSkin(){(darkStyle=document.getElementById("darkmode"))?setSkin("light"):setSkin("dark")}function createCookie(a,c,b){if(b){var d=new Date;d.setTime(d.getTime()+864E5*b);b="; expires="+d.toGMTString()}else b="";document.cookie=a+"="+c+b+"; path=/"}
6
+ function getCookieValue(a,c){return(c=document.cookie.match("(^|;)\\s*"+a+"\\s*=\\s*([^;]+)"))?c.pop():""};
files/www/hosted.html ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <title>Speedtest by OpenSpeedtest.com</title>
8
+ <style>
9
+ ::-webkit-scrollbar {
10
+ display: none;
11
+ }
12
+ html {
13
+ -ms-overflow-style: none;
14
+ scrollbar-width: none;
15
+ }
16
+ body{margin: 0px;}
17
+ </style>
18
+ </head>
19
+ <body>
20
+ <iframe id="OST-iFrame" src="//openspeedtest.com/selfhosted" style="width: 100vw;height: 100vh;" frameborder="0" allowfullscreen></iframe>
21
+ <div style="text-align: center; color: rgb(125 119 119); font-size:14px; ">
22
+ <a href="https://openspeedtest.com?ref=Self-Hosted-Widget&Run" style="text-decoration:none; color: rgb(125 119 119);"">Speed Test</a> by OpenSpeedTest™
23
+ </div>
24
+ </body>
25
+ </html>
files/www/index.html ADDED
@@ -0,0 +1,167 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <title>SpeedTest by OpenSpeedTest™</title>
5
+ <meta name="description"
6
+ content="Test your network speed now. HTML5 Network Performance Estimation Tool. Self-Hosted SpeedTest by OpenSpeedTest™"/>
7
+ <link href="assets/css/app.css" rel="stylesheet" type="text/css" />
8
+ <script> window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches&&(document.head.innerHTML+='<link id="darkmode" rel="stylesheet" href="assets/css/darkmode.css" type="text/css"/>');function getCookieValue(b,a){return(a=document.cookie.match("(^|;)\\s*"+b+"\\s*=\\s*([^;]+)"))?a.pop():""}if("light"===getCookieValue("mode")){var darkStyle=document.getElementById("darkmode");darkStyle&&darkStyle.parentNode.removeChild(darkStyle)}; </script>
9
+ <meta charset="UTF-8">
10
+ <meta name="viewport" content="width=device-width,initial-scale=1">
11
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
12
+ <meta property="og:image" content="assets/images/img.png" />
13
+ <link rel='canonical' href='https://openspeedtest.com'/>
14
+ <link rel="apple-touch-icon" sizes="180x180" href="assets/images/icons/apple-touch-icon.png">
15
+ <link rel="icon" type="image/png" sizes="32x32" href="assets/images/icons/favicon-32x32.png">
16
+ <link rel="icon" type="image/png" sizes="16x16" href="assets/images/icons/favicon-16x16.png">
17
+ <link rel="manifest" href="assets/images/icons/site.webmanifest">
18
+ <link rel="mask-icon" href="assets/images/icons/safari-pinned-tab.svg" color="#5bbad5">
19
+ <link rel="shortcut icon" href="assets/images/icons/favicon.ico">
20
+ <meta name="msapplication-TileColor" content="#ffc40d">
21
+ <meta name="msapplication-config" content="assets/images/icons/browserconfig.xml">
22
+ <meta name="theme-color" content="#ffffff">
23
+ </head>
24
+ <body>
25
+ <script type="text/javascript">
26
+ /*
27
+ Official Website : https://OpenSpeedTest.COM | Email: support@openspeedtest.com
28
+ Developed by : Vishnu | https://Vishnu.Pro | Email : me@vishnu.pro
29
+
30
+ HTML5 Network Performance Estimation Tool -> [JS,XHR,SVG,HTML,CSS]
31
+ Started in 2011 and Moved to OpenSpeedTest.COM, Dedicated Project/Domain Name in 2013.
32
+ SpeedTest Script -> 2013 -> Beta | 2015 -> V1 | 2019 ->V2 | 2020 V2.1 | 2021 V2.12 | 2022 V2.5 & 2.5.3
33
+ Self-Hosted OpenSpeedTest-Server (iFrame/Nginx) -> 2014. (Managed SelfHosted SpeedTesT Widget)
34
+ OpenSpeedTest-Server (On-premises) (Fully SelfHosted Apps)
35
+ [OpenSpeedTest-Server Docker Image] -> V1 2019 | V2 2020 | V2.1 2021 | V2.2 & 2.2.2 2022
36
+ [Node.js/Electron JS OpenSpeedTest-Server Desktop Apps] -> 2020 V1 | 2021 V2 & V2.1 | 2.1.1 to 2.1.8 2022
37
+ [Ionic Android and iOS OpenSpeedTest-Server Mobile Apps] V1.2 to 1.5 2022
38
+
39
+ Download Now -> https://go.openspeedtest.com/Server
40
+
41
+ Like this Project? Please Donate NOW & Keep us Alive -> https://go.openspeedtest.com/Donate
42
+
43
+ Speed Test by OpenSpeedTest™️ is Free and Open-Source Software (FOSS) with MIT License.
44
+ Read full license terms @ http://go.openspeedtest.com/License
45
+
46
+ If you have any Questions, ideas or Comments Please Send it via -> https://go.openspeedtest.com/SendMessage
47
+ */
48
+
49
+ // Add or Remove Server --> Automatically choose the one with the least latency
50
+ var openSpeedTestServerList = [
51
+ {"ServerName":"Home", "Download":"downloading", "Upload":"upload", "ServerIcon":"DefaultIcon"}
52
+ ];
53
+
54
+ // Send pings 'pingSamples' times to each Server URL.
55
+ var pingSamples = 10;
56
+
57
+ // 50% samples(Least)/length 1=100% 0.1 = 10%
58
+ var jitterFinalSample = 0.5;
59
+
60
+ // Set a pingSample dynamically by passing "Ping" or "p" as a URL Parameter.
61
+ var setPingSamples = true;
62
+
63
+ // If Server has not responded within 5 Seconds for any requests we send ('pingSamples' times)
64
+ // We will show Network Error. You can change the limit here.
65
+ // In milliseconds, if you need to set 6 seconds. Change the value to 6000.
66
+ var pingTimeOut = 5000;
67
+
68
+ // Set a PingTimeout dynamically by passing "Out" or "O" as a URL Parameter
69
+ var setPingTimeout = true;
70
+
71
+ // GET or HEAD // Other Methods may work. but why?
72
+ var pingMethod = "GET";
73
+
74
+ //Choose Download or Upload from the Server list. If you Prefer Download, change pingMethod to HEAD.
75
+ var pingFile = "Upload";
76
+
77
+ // The amount of garbage data sent to the server in Mb, 30 = 30Mb
78
+ var ulDataSize = 30;
79
+
80
+ // Don't touch it
81
+ var ulDelay = 300;
82
+ var dlDelay = 300;
83
+
84
+ // Overhead Compensation factor, This is a browser-dependent test, Many Unknowns. Currently, 4%. That is within the margin of error.
85
+ var upAdjust = 1.04;
86
+ var dlAdjust = 1.04;
87
+
88
+ // You can pass "Clean" or "C" as a URL Parameter and reset the Overhead Compensation factor to Zero or set any value between 0 and 4. 1 = 1% to 4 = 4%
89
+ // "clean" will not accept values above 4, so Compensation is limited to a maximum of 4%.
90
+ var enableClean = true;
91
+
92
+ // Minimum 12 Seconds is Expected.
93
+ var dlDuration = 12;
94
+ var ulDuration = 12;
95
+
96
+ // 6 is the common limit found on most browsers.
97
+ // Choose Number for parallel HTTP connections to Server | Default is 6
98
+ var dlThreads = 6;
99
+ var ulThreads = 6;
100
+
101
+ // Allow user to Change default limit of 6 parallel HTTP connections to Server | Accept values above 1 and max 32
102
+ // pass "XHR" or "X" as a URL Parameter
103
+ var setHTTPReq = true;
104
+
105
+ // Save Data to a Database
106
+ var saveData = false;
107
+ var saveDataURL = "//yourDatabase.Server.com:4500/save?data=";
108
+
109
+ // Allow user to change the default 12 seconds test duration
110
+ // Pass "Stress" or "S" as a URL Parameter.
111
+ var stressTest = true;
112
+
113
+ // Allow user to select and run one test at a time, download, upload, or ping
114
+ // Pass "Test" or "T" as a URL Parameter.
115
+ var selectTest = true;
116
+
117
+ // Allow user to select a different server to run a test
118
+ // Pass "Host" or "H" ad a URL Parameter.
119
+ // Accept only valid HTTP URLs like "http://192.168.1.10:3000" or "https://yourHost.com"
120
+ var selectServer = true;
121
+
122
+ // Start a test Automatically without pressing the start button
123
+ // You can Delay the test for 'n' seconds by passing any number as a value for Run Keyword. e.g.: "Run=10" or "R=10" to delay the test by 10 Seconds.
124
+ // Pass "Run" or "R" as a URL Parameter to start a test instantly.
125
+ var enableRun = true;
126
+
127
+ // "Run" will not work if you are already using 'selectTest' "Test" or "T" Keyword.
128
+
129
+
130
+ function ostOnload() {
131
+ console.log("OpenSpeedTest.com V2.5.4 Loaded!")
132
+ console.log("Now Press the Start Button or HIT Enter.")
133
+ console.log("The secret to living happy is giving happiness. Have a wonderful day.")
134
+
135
+ }
136
+
137
+ var openChannel = "dev";
138
+
139
+ </script>
140
+
141
+ <!--
142
+ Speed Test by OpenSpeedTest™️ is Free and Open-Source Software with MIT License.
143
+
144
+ You can play with the CSS, HTML & SVG files to change the colors or add your support desk info to this page.
145
+ Also, you can add your company logo anywhere on this page. It's FOSS. You can do whatever you see fit.
146
+
147
+ If you like to make any other modification to this application or need a custom deployment for your organization,
148
+ please get in touch with support@openspeedtest.com.
149
+ -->
150
+
151
+ <div id="loading_app" class="spinner">
152
+ <div class="bounce1"></div>
153
+ <div class="bounce2"></div>
154
+ <div class="bounce3"></div>
155
+ </div>
156
+ <object style="visibility:hidden" id="OpenSpeedTest-UI" data="assets/images/app.svg" type="image/svg+xml"></object>
157
+
158
+ <div class="Credits">
159
+ <a href="https://openspeedtest.com?ref=Self-Hosted&Run">SpeedTest by OpenSpeedTest™</a> is a Free and <a href="https://github.com/openspeedtest/Speed-Test">Open-Source HTML5 Network Speed Test</a> Software.
160
+ <p style="font-size: 12px;">© Copyright 2013-2023 OpenSpeedTest™ All Rights Reserved.</p>
161
+ </div>
162
+
163
+ <script src="assets/js/app-2.5.4.min.js"></script>
164
+ <script src="assets/js/darkmode.js"></script>
165
+
166
+ </body>
167
+ </html>
files/www/upload ADDED
File without changes