Squid Block Streaming

1.Create file user allow streaming list
#vi user_streaming.txt
-------------------------------user_streaming.txt--------------------------------------------
#user allow streaming
#Allow one by one
192.168.1.1

#Allow by network
192.168.2.0/24
------------------------------End of user_streaming.txt--------------------------------------



2.Create file Web allow streaming lish
#vi web_allow_streaming.txt
------------------------------web_allow_streaming.txt---------------------------------------
#Enter url you want to allow
#Example
youtube.com
video.google.com
------------------------------End of web_allow_streaming.txt-------------------------------



3. Edit squid.conf
#vi squid.conf

--------------------------------Squid.conf-----------------------------------------------------
#User for use stream techtoy-blog.blogspot.com
acl user_streaming src "/etc/squid/user_streaming.txt"

###########Block streaming techtoy-blog.blogspot.com##################
acl BlockExt url_regex -i \.mp3$ \.asx$ \.wma$ \.wmv$ \.avi$ \.mpeg$ \.mpg$ \.qt$ \.ram$ \.rm$ \.iso$ \.wav$ \.exe$
acl fails rep_mime_type ^.*mms.*
acl fails rep_mime_type ^.*ms-hdr.*
acl fails rep_mime_type ^.*x-fcs.*
acl fails rep_mime_type ^.*x-ms-asf.*

acl fails2 urlpath_regex dvrplayer mediastream mms://
acl fails2 urlpath_regex \.asf$ \.afx$ \.flv$ \.swf$

acl deny_rep_mime_flashvideo rep_mime_type -i video/flv
acl deny_rep_mime_shockwave rep_mime_type -i ^application/x-shockwave-flash$

acl x-type req_mime_type -i ^application/octet-stream$
acl x-type req_mime_type -i application/octet-stream
acl x-type req_mime_type -i ^application/x-mplayer2$
acl x-type req_mime_type -i application/x-mplayer2
acl x-type req_mime_type -i ^application/x-oleobject$
acl x-type req_mime_type -i application/x-oleobject
acl x-type req_mime_type -i application/x-pncmd
acl x-type req_mime_type -i ^video/x-ms-asf$
acl x-type req_mime_type -i ^application/vnd.ms.wms-hdr.asfv1$
acl x-type req_mime_type -i ^application/x-mms-framed$



acl x-type2 rep_mime_type -i ^application/octet-stream$
acl x-type2 rep_mime_type -i application/octet-stream
acl x-type2 rep_mime_type -i ^application/x-mplayer2$
acl x-type2 rep_mime_type -i application/x-mplayer2
acl x-type2 rep_mime_type -i ^application/x-oleobject$
acl x-type2 rep_mime_type -i application/x-oleobject
acl x-type2 rep_mime_type -i application/x-pncmd
acl x-type2 rep_mime_type -i ^video/x-ms-asf$
acl x-type2 req_mime_type -i ^application/vnd.ms.wms-hdr.asfv1$
acl x-type2 req_mime_type -i ^application/x-mms-framed$


##################################################


####################################
###Blockstreaming techtoy-blog.blogspot.com###
####################################
#Allow streaming for user_streaming only ##


http_access allow fails web_allow_streaming
http_reply_access allow fails web_allow_streaming
http_access deny fails !user_streaming
http_reply_access deny fails !user_streaming


http_access allow fails2 web_allow_streaming
http_reply_access allow fails2 web_allow_streaming
http_access deny fails2 !user_streaming
http_reply_access deny fails2 !user_streaming


http_access allow x-type web_allow_streaming
http_reply_access allow x-type web_allow_streaming
http_access deny x-type !user_streaming
http_reply_access deny x-type !user_streaming


http_access allow x-type2 web_allow_streaming
http_reply_access allow x-type2 web_allow_streaming
http_access deny x-type2 !user_streaming
http_reply_access deny x-type2 !user_streaming

http_access allow BlockExt web_allow_streaming
http_access deny BlockExt !user_streaming
###################################################
---------------------------------------End of squid.conf--------------------------------


4. Reload squid configuration
#service squid reload

ความคิดเห็น

ไม่ระบุชื่อ กล่าวว่า
In my opinion it already was discussed, use search.

บทความที่ได้รับความนิยม