firewall - Regex for Proxy Server to add edufilter to youtube requests -


i working on internet filtering. proprietary system suppose (comsifter), based on dan's guardian, there few people around here can benefit answer question.

i pretty sure regex url modify rules want use should similar these. formatting might different other programs, think makes sense doing. finds left, , replaces right redirect believe.

"https://www(\.google\..*)"->"https://nosslsearch\1" "(http://[^/]*www\.google\..*\?.*)"->"\1&safe=vss" "(http://[^/]*bing\..*\?.*)"->"\1&adlt=strict" "(http://[^/]*yahoo\..*\?.*)"->"\1&vm=r" "(http://[^/]*youtube\..*\?.*$)"->"\1&edufilter=wql9minebtaq3b9htraoia" "(http://[^/]*youtube\.[^?]*$)"->"http://youtube.com/?edufilter=wql9minebtaq3b9htraoia" "https://[^/]*youtube\..*"->"http://youtube.com/education" 

however, can't quite youtube ones work, think rest now. redirect loop on youtube pages, or time out, or depending try incoming url. tried code:

"(^http://[^/]*youtube\..*\?.*$)"->"\1&edufilter=wql9minebtaq3b9htraoia" "(^http://[^/]*youtube\.[^?]*$)"->"\1?edufilter=wql9minebtaq3b9htraoia" "^https://[^/]*youtube\..*"->"http://youtube.com" 

which seemed work sometimes, wasn't not quite right either. bet if had negation of edufilter in first line might help, can't figure out how that. on these rules, or better ones, more effecient ones, etc. appreciated. thanks.

this @ least partial answer. need figure out https line now.

from http://linuxcentre.net/wiki/index.php/web_content_filtering:

# youtube (use our unique youtube schools code) # remove existing edufilter param "(^http://[^/]*\.youtube\.[^?]*\?)(.+&)?(edufilter=[^&]*)"->"\1\2" # add in our edufilter param "(^http://[^/]*\.youtube\.[^?]*\?)"->"\1edufilter=your code here&" # or if no params add ours in "(^http://[^/]*\.youtube\.[^?]*$)"->"\1/?edufilter=your code here" 

seems work great on http requests.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -