linux poison RSS
linux poison Email

How to block flash videos using Squid proxy Server

A popular request is to block certain content types from being served to clients. Squid currently can not do "content inspection" to decide on the file type based on the contents, but it is able to block HTTP replies based on the servers' content MIME Type reply.

The MIME Type reply is generally set correctly so browsers are able to pass the reply to the correct module (image, text, html, flash, music, mpeg, etc.)

One popular example is to block flash video, used by sites such as Youtube.
The MIME type for such content is "video/x-flv". Creating an ACL to block this is easy.

First, create an ACL which matches the MIME type in question:
acl deny_rep_mime_flashvideo rep_mime_type video/x-flv
Then create a HTTP Reply ACL which denies any replies with that MIME type:
http_reply_access deny deny_rep_mime_flashvideo
This has been verified to block Youtube flash video content.

If the content is blocked the following similar line will be seen in access.log:

1282485682.146    903 TCP_DENIED_REPLY/403 3143 GET - DIRECT/ text/html

And on browser, you can see ...


Post a Comment

Related Posts with Thumbnails