Aug 11, 2012

How to Block Streaming Media From Squid Proxy

http://techsupportpk.blogspot.com/2013/05/how-to-block-streaming-media-from-squid.html

Often multimedia streaming is not good for the office environment. It will dry out the bandwidth of our network, thus slows it down. We can block the multimedia streaming using squid filter.
Below is the example of how I did it using squid:

Access Lis

acl stream1 rep_mime_type ^.*mms.*
acl stream1 rep_mime_type ^.*ms-hdr.*
acl stream1 rep_mime_type ^.*x-fcs.*
acl stream1 rep_mime_type ^.*x-ms-asf.*
acl stream2 urlpath_regex dvrplayer mediastream mms://
acl stream2 urlpath_regex \.asf$ \.afx$ \.flv$ \.swf$
acl stream3 rep_mime_type -i video/flv
acl stream3 rep_mime_type -i ^application/x-shockwave-flash$

acl STRMTIME1 time M T W H F 09:00-11:30
acl STRMTIME2 time M T W H F 11:31-13:59
acl STRMTIME3 time M T W H F 14:00-17:00

acl stream4 req_mime_type -i ^application/octet-stream$
acl stream4 req_mime_type -i application/octet-stream
acl stream4 req_mime_type -i ^application/x-mplayer2$
acl stream4 req_mime_type -i application/x-mplayer2
acl stream4 req_mime_type -i ^application/x-oleobject$
acl stream4 req_mime_type -i application/x-oleobject
acl stream4 req_mime_type -i application/x-pncmd
acl stream4 req_mime_type -i ^video/x-ms-asf$

acl stream5 rep_mime_type -i ^application/octet-stream$
acl stream5 rep_mime_type -i application/octet-stream
acl stream5 rep_mime_type -i ^application/x-mplayer2$
acl stream5 rep_mime_type -i application/x-mplayer2
acl stream5 rep_mime_type -i ^application/x-oleobject$
acl stream5 rep_mime_type -i application/x-oleobject
acl stream5 rep_mime_type -i application/x-pncmd
acl stream5 rep_mime_type -i ^video/x-ms-asf$

### Allow/Deny Rules ###

http_reply_access deny stream3 STRMTIME1
http_reply_access allow stream3 STRMTIME2
http_reply_access deny stream3 STRMTIME3

http_access deny stream1 STRMTIME1
http_access allow stream1 STRMTIME2
http_access deny stream1 STRMTIME3

http_reply_access deny stream1 STRMTIME1
http_reply_access allow stream1 STRMTIME2
http_reply_access deny stream1 STRMTIME3

http_access deny stream2 STRMTIME1
http_access allow stream2 STRMTIME2
http_access deny stream2 STRMTIME3

http_reply_access deny stream2 STRMTIME1
http_reply_access allow stream2 STRMTIME2
http_reply_access deny stream2 STRMTIME3

http_access deny stream4 STRMTIME1
http_access allow stream4 STRMTIME2
http_access deny stream4 STRMTIME3

http_reply_access deny stream4 STRMTIME1
http_reply_access allow stream4 STRMTIME2
http_reply_access deny stream4 STRMTIME3

http_access deny stream5 STRMTIME1
http_access allow stream5 STRMTIME2
http_access deny stream5 STRMTIME3

http_reply_access deny stream5 STRMTIME1
http_reply_access allow stream5 STRMTIME2
http_reply_access deny stream5 STRMTIME3

 
TECH SUPPORT © 2012-2016