[squid-users] Whether we can redirect video traffic to squid 2.7 via porting mirror

From: johnzeng <johnzeng2013_at_yahoo.com>
Date: Thu, 28 Aug 2014 23:51:04 +0800

Hi , i have a switch , and i hope to redirect video traffic to Cache via
using Port mirroring feature , and monitoring network traffic that
involves forwarding a copy of

each packet from one network switch.

Whether Squid 2.7 can listen and identify mirroring data packet ?

if Squid 2.7 can identify , i hope to match video part and send 302 http
packet to end user via url_rewrite_access and redirect the user's
request to Cache

Whether my thought is correct way ?

Or Whether we can realize the goal via dansguardian + squid or
squidguard + squid or icap +squid .... ?

if possible , please help me .

***********************************************

url_rewrite_program /cache/video_operation
url_rewrite_children 10

acl location_rewrite_video url_regex -i
^http://[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\/video\/.*\.(m4v|flv|mp4|wmv|rm|ram|mov|avi|mp3)\?nk=

url_rewrite_access allow location_rewrite_video

ÕâÊÇpart program of video_operation

int video(string *domain, string *urlf)
{
if(regexMatch("^http://[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\/video/",
*urlf)){
if(regexMatch("\\.(flv|mp4)$",*urlf) ||
regexMatch("\\.(flv|mp4)\\?start=", *urlf)){
*urlf = "http://192.168.2.6/video/" + get_foldername(*urlf, 1) + "/" +
get_filename(*urlf);
} else if (regexMatch("\\.(flv|mp4)\\?special=true$",*urlf)) {
//redirect sphotos and photos-[a-z] to the same url
*urlf = *domain +"/" + ".video/" + get_foldername(*urlf, 1) + "/" +
get_filename(*urlf) + "?special=true";
}
else if (regexMatch("\\.(flv|mp4)\\?nk=",*urlf)) { //redirect sphotos
and photos-[a-z] to the same url
*urlf = "302:http://192.168.2.6/video/" + get_foldername(*urlf, 1) + "/"
+ get_filename(*urlf);
}
return 1;
}
return 0;
}
Received on Thu Aug 28 2014 - 15:51:21 MDT

This archive was generated by hypermail 2.2.0 : Thu Aug 28 2014 - 12:00:07 MDT