Time for action – blocking video content

So, for blocking the video content, first we'll need to identify all the requests for video content. For this purpose, we can simply use the ACL type url_regex as follows:

acl video_content urlpath_regex -i \.(mpg|mpeg|avi|mov|flv|wmv|mkv|rmvb)(\?.*)?$

The previous ACL list will match all the URLs ending with extensions of common video formats.

As a video can be served using dynamic URLs, the URL returning video content may not look like a URL to a video file at all. For achieving better control, we also need to use the ACL type rep_mime_type to detect the content type of the replies returned by webservers. So, we can construct another ACL list as follows:

acl video_in_reply rep_mime_type -i ^video\/

The previous ...

Get Squid Proxy Server 3.1 Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.