limit Video Streaming by squid

Bookmark and Share
membatasi bandwidth client dengan scrip yang ditambahkan di squid.conf :
1. tambahkan scrip dibawah ini di squid.conf
2. simpan dan exit
3. restart squid via Run ---> services.msc ----> klik kanan services squid ---> restart

** scrip berikut mempunyai keistimewaan :
a. browsing mendapatkan full speed
b. apapun yg pernah di cache (download n streaming, contohnya) tidak akan terlimited
c. game-online tetap lancar tanpa "lag"
d. kompi yg terinstall squid ikut terlimit "download dan streamingnya" tidak terlimit lainnya

**** silahkan pilih dari beberapa cara scrip dibawah ini ***
**** semua cara dibawah ini untuk melimit download n streaming s/d 48KBps *****
**** ubah batasan limited dengan mengubah angka 48000 menjadi suka-suka saja ***

**** letakkan salah satu cara script dibawah ini pada bagian ****
#################################################
# Simple delaypools added by imer :shakehand #
# default setting is disabled #
# enable it by removing # mark at start of line #
#################################################

####cara pertama - class 2###
# bila client melakukan download file apapun
acl jupukfile url_regex -i \.*

# bila client melakukan streaming video
acl delokvideo url_regex -i watch\? get_video\?video_id videodownload\? videoplayback\? videoplay\? dailymotion video\.[a-z]\.fbcdn\.net video\flv video\mpg video\quicktime video\x-flv video\mp4 video\x-avi video\x-mpeg video\x-wmv video\flash video\x-mpeg4 video\x-mpg video\x-mov video\mov video\avi

# dibuat 2 aturan
delay_pools 2

# aturan 1, tidak ada pembatasan untuk browsing
delay_class 1 2
delay_parameters 1 -1/-1 -1/-1

# aturan 2, setelah download/streaming 512 KB mk download/streaming menjadi 48 KBps
delay_class 2 2
delay_parameters 2 -1/512000 48000/513000

# menerapkan aturan, aturan diterapkan dulu dari aturan ke 2 #
# bila bukan termasuk aturan ke 2, maka akan diterapkan aturan ke 1 #
delay_access 2 allow jupukfile
delay_access 2 allow delokvideo
delay_access 2 deny all

delay_access 1 deny jupukfile
delay_access 1 deny delokvideo
delay_access 1 allow all
####EOF cara pertama - class 2####




####cara kedua - class 2###
# bila client melakukan download file apapun
acl jupukfile url_regex -i \.*

# bila client melakukan streaming video
acl delokvideo url_regex -i watch\? get_video\?video_id videodownload\? videoplayback\? videoplay\? dailymotion video\.[a-z]\.fbcdn\.net video\flv video\mpg video\quicktime video\x-flv video\mp4 video\x-avi video\x-mpeg video\x-wmv video\flash video\x-mpeg4 video\x-mpg video\x-mov video\mov video\avi

# dibuat 2 aturan
delay_pools 2

# aturan 1, tidak ada pembatasan untuk browsing
delay_class 1 2
delay_parameters 1 -1/-1 -1/-1

# aturan 2, setelah download/streaming 512 KB mk download/streaming menjadi 48 KBps
delay_class 2 2
delay_parameters 2 -1/-1 48000/513000

# menerapkan aturan, aturan diterapkan dulu dari aturan ke 2 #
# bila bukan termasuk aturan ke 2, maka akan diterapkan aturan ke 1 #
delay_access 2 allow jupukfile
delay_access 2 allow delokvideo
delay_access 2 deny all

delay_access 1 deny jupukfile
delay_access 1 deny delokvideo
delay_access 1 allow all
####EOF cara kedua - class 2####


####cara ketiga - class 1###
# bila client melakukan download file apapun
acl jupukfile url_regex -i \.*

# bila client melakukan streaming video
acl delokvideo url_regex -i watch\? get_video\?video_id videodownload\? videoplayback\? videoplay\? dailymotion video\.[a-z]\.fbcdn\.net video\flv video\mpg video\quicktime video\x-flv video\mp4 video\x-avi video\x-mpeg video\x-wmv video\flash video\x-mpeg4 video\x-mpg video\x-mov video\mov video\avi

# dibuat 2 aturan
delay_pools 2

# aturan 1, tidak ada pembatasan untuk browsing
delay_class 1 1
delay_parameters 1 -1/-1

# aturan 2, setelah download/streaming 512 KB mk download/streaming menjadi 48 KBps
delay_class 2 1
delay_parameters 2 48000/513000

# menerapkan aturan, aturan diterapkan dulu dari aturan ke 2 #
# bila bukan termasuk aturan ke 2, maka akan diterapkan aturan ke 1 #
delay_access 2 allow jupukfile
delay_access 2 allow delokvideo
delay_access 2 deny all

delay_access 1 deny jupukfile
delay_access 1 deny delokvideo
delay_access 1 allow all
####EOF cara ketiga - class 1####


####cara keempat - class 1###
# bila client melakukan download file apapun
acl jupukfile url_regex -i \.*

# bila client melakukan streaming video
acl delokvideo url_regex -i watch\? get_video\?video_id videodownload\? videoplayback\? videoplay\? dailymotion video\.[a-z]\.fbcdn\.net video\flv video\mpg video\quicktime video\x-flv video\mp4 video\x-avi video\x-mpeg video\x-wmv video\flash video\x-mpeg4 video\x-mpg video\x-mov video\mov video\avi

# dibuat 2 aturan
delay_pools 2

# aturan 1, tidak ada pembatasan untuk browsing
delay_class 1 1
delay_parameters 1 -1/-1
delay_access 1 deny jupukfile
delay_access 1 deny delokvideo
delay_access 1 allow all

# aturan 2, setelah download/streaming 512000 bytes mk download/streaming menjadi 48000 bytes/s

delay_class 2 1
delay_parameters 2 48000/512000
delay_access 2 allow jupukfile
delay_access 2 allow delokvideo
delay_access 2 deny all

####EOF cara keempat - class 1#### 

sumber :cyberblok12.blogspot.com

{ 0 comments... Views All / Send Comment! }

Post a Comment