Buenos días amigos del foro.
Por favor me pueden ayudar con el código de speedtest del servidor telconet de Ecuador.
He intentado con el siguiente código, pero no me está funcionando el caché:
#include <iostream>
#include <cstring>
#include <string>
#include <vector>
#include "../utils.cpp"
using namespace std;
// use this line to compile
// g++ -I. -fPIC -shared -g -o speedtest1.telconet.net.so speedtest1.telconet.net.cpp
// Regex
// http.*\.speedtest1\.telconet\.net.*(\.jpg|\.png)
string get_filename(string url) {
vector<string> resultado;
string retorna = "";
stringexplode(url, "/", &resultado);
retorna = resultado.at(resultado.size()-2) + "-"+resultado.at(resultado.size()-1);
return retorna;
}
extern "C" resposta getmatch(const string url) {
resposta r;
if ( (url.find("speedtest1.telconet.net//") != string::npos)
) {
r.file = get_filename(url);
if (!r.file.empty()) {
r.match = true;
r.domain = "speedtest1.telconet";
} else {
r.match = false;
}
}
else
{
r.match = false;
}
return r;
}
Cuando realizo las pruebas el squid me muestra lo siguiente:
1388514789.876 24 192.168.0.10 TCP_MISS/200 376 GET http://speedtest1.telconet.net/speedtest/latency.txt? - HIER_DIRECT/186.101.5.254 text/plain
1388514789.980 23 192.168.0.10 TCP_MISS/200 376 GET http://speedtest1.telconet.net/speedtest/latency.txt? - HIER_DIRECT/186.101.5.254 text/plain
1388514790.107 24 192.168.0.10 TCP_MISS/200 376 GET http://speedtest1.telconet.net/speedtest/latency.txt? - HIER_DIRECT/186.101.5.254 text/plain
1388514790.211 26 192.168.0.10 TCP_MISS/200 376 GET http://speedtest1.telconet.net/speedtest/latency.txt? - HIER_DIRECT/186.101.5.254 text/plain
1388514790.306 21 192.168.0.10 TCP_MISS/200 376 GET http://speedtest1.telconet.net/speedtest/latency.txt? - HIER_DIRECT/186.101.5.254 text/plain
1388514790.396 13 192.168.0.10 TCP_MISS/200 376 GET http://speedtest1.telconet.net/speedtest/latency.txt? - HIER_DIRECT/186.101.5.254 text/plain
1388514790.497 14 192.168.0.10 TCP_MISS/200 376 GET http://speedtest1.telconet.net/speedtest/latency.txt? - HIER_DIRECT/186.101.5.254 text/plain
1388514790.600 13 192.168.0.10 TCP_MISS/200 376 GET http://speedtest1.telconet.net/speedtest/latency.txt? - HIER_DIRECT/186.101.5.254 text/plain
1388514791.625 938 192.168.0.10 TCP_MISS/200 376 GET http://speedtest1.telconet.net/speedtest/latency.txt? - HIER_DIRECT/186.101.5.254 text/plain
1388514791.735 21 192.168.0.10 TCP_MISS/200 376 GET http://speedtest1.telconet.net/speedtest/latency.txt? - HIER_DIRECT/186.101.5.254 text/plain
1388514792.306 520 192.168.0.10 TCP_MISS/200 245747 GET http://speedtest1.telconet.net/speedtest/random350x350.jpg? - HIER_DIRECT/186.101.5.254 image/jpeg
1388514792.389 586 192.168.0.10 TCP_MISS/200 245747 GET http://speedtest1.telconet.net/speedtest/random350x350.jpg? - HIER_DIRECT/186.101.5.254 image/jpeg
1388514799.554 6673 192.168.0.10 TCP_MISS/200 1118373 GET http://speedtest1.telconet.net/speedtest/random750x750.jpg? - HIER_DIRECT/186.101.5.254 image/jpeg
1388514800.803 7941 192.168.0.10 TCP_MISS/200 1118373 GET http://speedtest1.telconet.net/speedtest/random750x750.jpg? - HIER_DIRECT/186.101.5.254 image/jpeg
1388514801.253 8336 192.168.0.10 TCP_MISS/200 1118373 GET http://speedtest1.telconet.net/speedtest/random750x750.jpg? - HIER_DIRECT/186.101.5.254 image/jpeg
1388514801.722 8804 192.168.0.10 TCP_MISS/200 1118373 GET http://speedtest1.telconet.net/speedtest/random750x750.jpg? - HIER_DIRECT/186.101.5.254 image/jpeg
1388514802.260 191 192.168.0.10 TCP_MISS/200 304 POST http://speedtest1.telconet.net/speedtest/upload.php? - HIER_DIRECT/186.101.5.254 text/html
1388514802.292 198 192.168.0.10 TCP_MISS/200 304 POST http://speedtest1.telconet.net/speedtest/upload.php? - HIER_DIRECT/186.101.5.254 text/html
1388514802.559 156 192.168.0.10 TCP_MISS/200 304 POST http://speedtest1.telconet.net/speedtest/upload.php? - HIER_DIRECT/186.101.5.254 text/html
1388514802.858 436 192.168.0.10 TCP_MISS/200 304 POST http://speedtest1.telconet.net/speedtest/upload.php? - HIER_DIRECT/186.101.5.254 text/html
1388514806.793 2648 192.168.0.10 TCP_MISS/200 305 POST http://speedtest1.telconet.net/speedtest/upload.php? - HIER_DIRECT/186.101.5.254 text/html
1388514808.114 3942 192.168.0.10 TCP_MISS/200 305 POST http://speedtest1.telconet.net/speedtest/upload.php? - HIER_DIRECT/186.101.5.254 text/html
1388514809.985 1736 192.168.0.10 TCP_MISS/200 305 POST http://speedtest1.telconet.net/speedtest/upload.php? - HIER_DIRECT/186.101.5.254 text/html
1388514810.191 1928 192.168.0.10 TCP_MISS/200 305 POST http://speedtest1.telconet.net/speedtest/upload.php? - HIER_DIRECT/186.101.5.254 text/html
1388514812.233 1850 192.168.0.10 TCP_MISS/200 305 POST http://speedtest1.telconet.net/speedtest/upload.php? - HIER_DIRECT/186.101.5.254 text/html
1388514812.334 1968 192.168.0.10 TCP_MISS/200 305 POST http://speedtest1.telconet.net/speedtest/upload.php? - HIER_DIRECT/186.101.5.254 text/html
1388514814.434 1953 192.168.0.10 TCP_MISS/200 305 POST http://speedtest1.telconet.net/speedtest/upload.php? - HIER_DIRECT/186.101.5.254 text/html
1388514814.449 1904 192.168.0.10 TCP_MISS/200 305 POST http://speedtest1.telconet.net/speedtest/upload.php? - HIER_DIRECT/186.101.5.254 text/html
Pero no se por que no funciona, use el mismo código con el servidor de la cnt, y con ese si registro HIT de parte del raptor.
Desde ya muchas gracias por su respuesta, y que tengan un feliz año!
Prueba con el plugin como esta, pero con el regex de este modo:
http.*speedtest1\.telconet\.net.*(\.jpg|\.png)
Prueba y me avisas, Saludos
Muchas gracias, funciona!
Cita de: Nessa en Enero 01, 2014, 04:12:46 PM
Muchas gracias, funciona!
Que bueno que te funciono, solo habia que cambiar el regex, para que pudiera hacer cache del contenido, Saludos
No hace hit quien me puede ayudar
Cita de: cmoya en Enero 27, 2015, 06:16:42 PM
No hace hit quien me puede ayudar
Que es lo que no te hace cache, el detalle es de si eres de ecuador, ya que si no lo eres el detalle es que cambiara de servidor, Saludos
saludo yo soy de venezuela lo instale y veia que no hacia hit no sabia porque ahora me estoyb dando cuanta es como no soy de ecuador no funciona
ahora bien como podemos hacer para que los que no son de ecuador le haga hit ????? ??? ??? ??? ???
Cita de: josemanuel155 en Enero 29, 2015, 01:55:05 PM
saludo yo soy de venezuela lo instale y veia que no hacia hit no sabia porque ahora me estoyb dando cuanta es como no soy de ecuador no funciona
ahora bien como podemos hacer para que los que no son de ecuador le haga hit ????? ??? ??? ??? ???
Tienes que ver que urls o fuentes descarga, asi se areglaria dicho plugin ya haciendo con las fuentes que proporciones, Saludos
firecold nos puede ayudar por favor
Cita de: cmoya en Febrero 03, 2015, 11:03:11 AM
firecold nos puede ayudar por favor
Disculpe mi amigo por no poder contestar ya que no esta disponiendo de mi tiempo por causa del trabajo y estudio, pero si seria bueno que me hecharan un poco la la mano consiguiendo las fuentes que no son mas que las urls completas de los extensiones que desean hacer cache, Saludos