A
A
Alexander Sharomet2016-09-14 17:22:58
Programming
Alexander Sharomet, 2016-09-14 17:22:58

How to block video content using squid?

Hello.
I have windows 7 x64 on my PC. Internet through a router.
I installed and started squid 2.5.7 according to the instructions.
When blocking all content http_access deny all everything works, it blocks outputs what would have turned to the webmaster.
Trying to block video content

acl cont-type-video rep_mime_type Content-Type video
acl cont-type-audio rep_mime_type Content-Type audio
acl inetradio_rep rep_mime_type ^application/x-mms-framed$ ^application/vnd.ms.wms-hdr.asfv$
acl inetradio_req req_mime_type ^application/x-mms-framed$ ^application/vnd.ms.wms-hdr.asfv$
acl StreamMedia rep_mime_type ^.*video.*
acl StreamMedia rep_mime_type ^.*audio.*

http_access deny inetradio_req
http_reply_access deny inetradio_rep
http_reply_access deny StreamMedia
http_reply_access deny cont-type-video
http_reply_access deny cont-type-audio

nothing is blocked. I enter all this business in squid.conf.
What am I doing wrong? Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
CityCat4, 2016-09-15
@sharomet

I never tried to block by mime-type, I always did it in a simple way. A file is created where the types of video files are registered:

\.mp[34eg]?[2g]?[4]?$
\.avi.?$
\.mov.?$
\.flv.?$
\.wmv.?$
\.3gp.?$
\.mkv.?$
\.ogg.?$

Then it blocks based on this file:
acl multimedia url_regex -i "/usr/local/squid/conf/policy/multimedia.url"
http_access deny multimedia

Of course, you can rename files (on hostings), earlier some like zaycev.net indulged in this, but now everyone is lazy, and for streaming playback you can’t rename them at all - otherwise it won’t work.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question