SHARE
TWEET

Untitled

a guest Aug 12th, 2017 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function isMatchProxy(url, pattern) {
  2.     try {
  3.         return new RegExp(pattern.replace('.', '\\.')).test(url);
  4.     } catch (e) {
  5.         return false;
  6.     }
  7. }
  8.  
  9. function FindProxyForURL(url, host) {
  10.     var Proxy = 'PROXY 127.0.0.1:10800';
  11.  
  12.     var list = [
  13.         'qq.com'
  14.     ];
  15.  
  16.     for(var i=0, l=list.length; i<l; i++) {
  17.         if (isMatchProxy(url, list[i])) {
  18.             return Proxy;
  19.         }
  20.     }
  21.     return 'DIRECT';
  22. }
RAW Paste Data
Top