It would be great if you can add TOS/DSCP support for youtube_cache , it will stream the videos to my users and bypass the download limits
28 Answers
TOS/DSCP is a squid thing and you can set that in squid configuration itself. Youtube Cache is just a plugin to help squid in caching dynamic videos served by various websites.
you are right , but take a look at this from access.log
192.168.0.3 TCP_MISS/200 8266426 GET http://192.168.0.1/video_cache/youtube/gvoQO_-CarE.flv?
as you can see ,the video is being retrieved from the video_cache , but it is coming as a miss , is it possible to return it as a HIT.
This way TOS/DSCP will work with youtube
Thanx.
Actually redirectors/url rewriters or other squid plugins are not allowed to do set TOS/DSCP. So there is almost nothing that can be done about it. Though I am exploring the possibilities, I have little hope :|
well, you could use netfilter for that. set TOS/DSCP to everything going out from your local apache port.
Hi!
Thanks for the suggestions. I hope this will help people wanting TOS/DSCP :)
Thank You!
please any example of using netfilter for a newbie in linux .. its so important to change the tos of hit video file ..
so , should i put this in debian IP-table :
iptables –A OUTPUT –t mangle –sp 80 –set-tos 0x30
is this correct for debian ? i think it needs some corrections ..
Anon,
I am not good at iptables. May be some other member will help or try asking in some iptables forums.
Thank You!
Imriz,
As far as I know, newer kernels doesn't allow matching using uid/gid . Correct me if I am wrong.
Thank You!
Uhmm, the iptables man page on a RHEL 5.3 machine indicates it is supported, but I haven't tried that my self.
I tried uid/gid , the problem is the packets output from apache is going to squid , its not going out from the output interface to mikrotik directly .. so it wont be marked by matching the uid/gid ..
only the packets out from the interface will be marked , which are coming from squid not apache ..
also tried the port 80 , same thing ..
Why would you route the apache through the squid??
If this is a transparent proxy, like in my setup, you should make sure that access to the apache should go directly to the apache and not through squid.
well , i dont think its routed through squid , and squid is transparnet also ..
but all packets coming to mikrotik from the cache server are coming from serverIP:squid port .. even cached youtube packets not from serverIP:apache port ..
so that i guess all packets requested by mikrotik should come from the squid port ..
I test if i request somthing directly from apache , yes it's working , easily i can change its DSCP using IP-table output uid=www-data, and mikrotik can recognize it ..
if my conclusion is right , so the question is if a packet come from apache with a specific dscp value , how can we keep this value untill it reaches mikrotik , i mean we dont want squid to change the packets dscp .. may be the reason is that zph is doing this for miss packets ? i mean we have to make zph changes only dscp of hit packets , and leaves the miss packets as it is ..
You need an iptables rule to avoid redirecting traffic to the apache into squid. Something like this:
iptables -t nat -A PREROUTING -i <yourincominginterface> -s ! <yourserverip> -d ! <yourserverip> -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3128
maybe i should be more clear about my setup :
videocahe + squid installed in single interface server , connected to mikrotik through this interface ..
the request coming from mikrotik to squid:3128 ..
your last example rule is to redirecting every packets coming from the interface , not from squid ip , not going to squid ip , has dst port 80 , to be redirected to port 3128 !!!!
which i cant understand !!!!!!!!!!!!!!
yesssss I did it , finally
now any cached video is downloading by clients is in unlimited speed !!!!!!!!!
thanks alot my friends for all of your great suggestions ..
actually i did it by the mikrotik itself , marking the squidIP:80 ..
sorry for my bad english
you wrote
"...
yesssss I did it , finally
now any cached video is downloading by clients is in unlimited speed !!!!!!!!!
thanks alot my friends for all of your great suggestions ..
actually i did it by the mikrotik itself , marking the squidIP:80 ..
...."
can you help me ? what is "squidIP:80 --" i need the rule you add in a /ip firewall mangle
thanks.
Hi there, You finally made it, !!! Marking connections/packets coming from your SquidIP:80 ... but this way aren't you allowing ALL packets coming from SquidIP:80 at full speed? Even the packets that have not been cached yet or packets that are un-cacheable ... so actually not controlling HTTP bandwidth to your clients... or am I wrong?
Jorge,
The traffic squidIP:80 means the HTTP traffic from a webserver running on squid machine. While the other HTTP traffic served to clients is search via squidIP:squidPort and not squidIP:80. So, you are basically not allowing all the traffic at full speed.
Thank You!
Thanks for the point, I analyzed these later and certainly you are right.
Regards
JB
Hi
i have problem with mikrotik i see all reply but i do not understand now how to set mikrotik to listin to cachevideo i have problem with play the video ( An error occurred, please try again later.) in mikrotik only
but in set the proxy:ip and proxy:3128 in firefox it is working good
all file it is caching good
now how to solve this problem Plz Help me for that and thanks for help
sorry for bad english
Hi all ...
I'm using Mikrotik for gateway and Videocache + squid + frox in DMZ
It's work !!! file cached is unlimited traffic going to LAN
u can read in forum > support
Thanks
Zinhell,
Congrats for the setup. It would be great if you can post your configuration files or steps you followed to configure different things.
Thank You!
I tried the squid.ip:80 on my Mikrotik. It does not work! I mean yes you can set unlimited speed for videocache/youtube/youporn/etc.. BUT http downloads Also get unlimited speed because it also uses port 80. I tried to use a download manager and OMG! it is eating up my bandwidth!
Meybe someone have any more ideas?