такой функционал есть в 3proxy http://3proxy.ru/plugins/PCREPlugin/
Но у меня запустить не получилось, может кому повезет больше.
Конфиг
PHP Code:
#!/usr/local/bin/3proxy
writable
pidfile /tmp/var/run/3proxy.pid
internal 192.168.1.100
external 0.0.0.0
nserver 82.144.192.130
nserver 82.144.192.131
nserver 82.144.192.32
nserver 82.144.192.30
nscache 65536
timeouts 1 5 30 60 180 1800 15 60
monitor /tmp/harddisk/3proxy/3proxy.cfg
#monitor /tmp/harddisk/3proxy/counters
monitor /tmp/harddisk/3proxy/passwd
#monitor /tmp/harddisk/3proxy/bandlimiters
log /tmp/harddisk/3proxy/proxy.log D
logformat "L%C - %U [%d/%o/%Y:%H:%M:%S %z] ""%T"" %E %I %O %N/%R:%r"
rotate 30
counter "/tmp/harddisk/3proxy/3proxy.3cf" D "/tmp/harddisk/3proxy/traf"
$/tmp/harddisk/3proxy/passwd
plugin /tmp/harddisk/3proxy/PCREPlugin.ld.so pcre_plugin
#WEB
nsrecord vkontakte.ru 64.233.187.99
#bandlimin 64000 * 192.168.1.200
deny * 192.168.1.200 * 80,443 * 1-4 00:00:00-18:30:00,21:30:01-24:00:00
allow * 192.168.1.200 * 80,443 * 1-4 18:30:01-21:30:00
deny * 192.168.1.200 * 80,443 * 5-7 00:00:00-07:30:00,22:30:01-24:00:00
allow * 192.168.1.200 * 80,443 * 5-7 07:30:01-22:30:00
#allow * 192.168.1.200 * * * 5-7 00:00:00-24:00:00
allow * 192.168.1.2 * * * 1-7 00:00:00-24:00:00
#allow * 192.168.1.200 * * * 1-7 00:00:00-24:00:00
#allow * 192.168.1.25 * * * 1-7 00:00:00-24:00:00
auth iponly
#auth none
proxy -a2 -p3128 -i192.168.1.100
#ICQ
flush
deny nata 192.168.1.200 * 5190 * 1-4 00:00:00-19:30:00,21:30:01-24:00:00
allow nata 192.168.1.200 * 5190 * 1-4 19:30:01-21:30:00
deny * 192.168.1.200 * 5190 * 5-7 00:00:00-07:30:00,22:30:01-24:00:00
allow * 192.168.1.200 * 5190 * 5-7 07:30:01-22:30:00
allow * 192.168.1.2 * * * 1-7 00:00:00-24:00:00
auth iponly strong
allow admin,igor,nata
socks
#adminka
flush
allow admin
admin -p8282