function header_send() local base_ip= hc.get_global('IPList2proxy_ip') local base_name= hc.get_global('IPList2proxy_name') if #base_ip<1 and #base_name<1 then return end local Host = re.find(hc.request_header, [[^Host: *\K[^(\r\n)|(:)]+]]) hc.put_to_log('Host-'..Host) -- hc.put_to_log('Host2-'..hc.request_header) if not Host then return end --- check hame local i for i=1,#base_name do if base_name[i]==Host then hc.use_proxy= 'proxy.antizapret.prostovpn.org:3128'; --hc.put_to_log('monstring='..hc.monitor_string) hc.monitor_string = hc.monitor_string .. ', IPlist2proxy' --hc.put_to_log('monstring2='..hc.monitor_string) return end end
local IP= hc.get_host_IP(Host) --hc.put_to_log('url-'..hc.url..' IP-'..IP) --- check ip if not IP then return end --for i=1, #al do for i=1, #base_ip do if base_ip[i]==IP then hc.use_proxy= 'proxy.antizapret.prostovpn.org:3128'; hc.monitor_string = hc.monitor_string .. ', IPlist2proxy' return
function timer() t= os.time() if hc_static['NextStart'] < t then hc_static['LastStart']= t hc_static['NextStart']= t+hc_static['Period']*60 SaveParams() local https_header = 'CONNECT https://antizapret.prostovpn.org:443 HTTP/1.1\r\nHost: https://antizapret.prostovpn.org\r\nConnection: keep-alive\r\n\r\n' hc.send_request('GET https://antizapret.prostovpn.org/proxy.pac HTTP/1.1\r\nUser-Agent: IPList\r\nConnection: close\r\n\r\n','',https_header) --hc.execute_cmd('ClearCache') --hc.put_msg('Загрузка и обновление pac') local s,e=hc.get_cache_file_name('https://antizapret.prostovpn.org/proxy.pac') hc.put_to_log('pac file loaded to- '..s) if e then local f = io.open(s, 'r') if f then local FilePac = f:read('*a') f:close() f = io.open(get_path()..[[proxy.pac]],'w') if f then f:write(FilePac) f:close() read_pac()
local https_header = 'CONNECT https://antizapret.prostovpn.org:443 HTTP/1.1\r\nHost: https://antizapret.prostovpn.org\r\nConnection: keep-alive\r\n\r\n' hc.send_request('GET https://antizapret.prostovpn.org/proxy.pac HTTP/1.1\r\nUser-Agent: IPList\r\nConnection: close\r\n\r\n','',https_header)
// Generated on Fri Jan 12 11:10:49 MSK 2018d_ad = "\ // это начало списка?a-class.org \a-diplom.com \a-diploma.com \a-diplomas.com \a-diploms.com \a-hentai.com \a-mks.ru \a-plagiata.net \a-pozdrav.info \ ".split(" "); //а это закрытие конца текста списков сайтов?on FindProxyForURL(url, host) { if (/\.(ru|co|cu|com|info|net|org|gov|edu|int|mil|biz|pp|ne|msk|spb|nnov|od|in|ho|cc|dn|i|tut|v|dp|sl|ddns|duckdns|livejournal|herokuapp|azurewebsites|ucoz)\.[^.]+$/.test(host)) host = host.replace(/(.+)\.([^.]+\.[^.]+\.[^.]+$)/, "$2"); else host = host.replace(/(.+)\.([^.]+\.[^.]+$)/, "$2"); if (/^[a-d]/.test(host)) curarr = d_ad; else if (/^[e-h]/.test(host)) curarr = d_eh; else if (/^[i-l]/.test(host)) curarr = d_il; else if (/^[m-p]/.test(host)) curarr = d_mp; else if (/^[q-t]/.test(host)) curarr = d_qt; else if (/^[u-z]/.test(host)) curarr = d_uz; else curarr = d_other; var oip = dnsResolve(host); for (var i = 0; i < d_ipaddr.length; i++) if (oip === d_ipaddr[i]) {oip = 1; break;} for (var i = 0; i < curarr.length; i++) { if (oip === 1 || host === curarr[i]) { return "HTTPS 192.30.85.22 1080; PROXY 192.30.85.22 1080; DIRECT"; //proxy.antizapret.prostovpn.org:3128 меняем на наше прокси 192.30.85.22 1080 } } return "DIRECT";