fork download
  1. //file://c:/Windows/IEProxySettings.pac
  2.  
  3. function FindProxyForURL(url, host)
  4. {
  5. // For instance, if the server has 4 alphabetic characters,
  6. // such as "MSDN", route it through a specific proxy:
  7.  
  8. if (shExpMatch(url, "*prod-pwd-vdb1.vega.ironport.com:7272*"))
  9. return "PROXY 10.30.40.30:3128";
  10.  
  11. if (shExpMatch(url, "*prod-pwd-db-m1.vega.ironport.com:7272*"))
  12. return "PROXY 10.30.40.30:3128";
  13.  
  14. if (shExpMatch(url, "*opsmgr.vega.ironport.com:8443*"))
  15. return "PROXY 10.30.40.30:3128";
  16.  
  17. if (shExpMatch(url, "*sgg.cisco.com*"))
  18. return "PROXY 10.30.40.30:3128";
  19.  
  20. if (shExpMatch(host, "devcloud.ironport.com"))
  21. return "DIRECT";
  22.  
  23.  
  24. if (shExpMatch(host, "*.ironport.com"))
  25. return "PROXY 10.30.40.30:3128";
  26.  
  27. //Pandora
  28. // https://m...content-available-to-author-only...t.com/chrome.pac
  29.  
  30. var country = 'UA';
  31. var myip = myIpAddress();
  32. var ipbits = myip.split('.');
  33. var myseg = parseInt(ipbits[3]);
  34. var p = [3223469900, 3223469902, 3226589467, 628805681, 3231406921, 3334957773, 1806365296, 1790653165, 1481686931];
  35. for(var i in p){
  36. n = p[i];
  37. var d = n%256;
  38. for(var j = 3; j > 0; j--){
  39. n = Math.floor(n/256);
  40. d = n%256 + '.' + d;
  41. }
  42. p[i] = d;
  43. }
  44. var proxy_configs = [
  45. 'PROXY '+p[0]+':80; PROXY '+p[1]+':80; DIRECT',
  46. 'PROXY '+p[1]+':80; PROXY '+p[0]+':80; DIRECT'
  47. ];
  48. var netflix_proxy_configs = [
  49. 'PROXY '+p[6]+':80; PROXY '+p[5]+':80; DIRECT',
  50. 'PROXY '+p[5]+':80; PROXY '+p[6]+':80; DIRECT'
  51. ];
  52. var uk_configs = [
  53. 'PROXY '+p[3]+':80; PROXY '+p[8]+':80; DIRECT',
  54. 'PROXY '+p[8]+':80; PROXY '+p[3]+':80; DIRECT'
  55. ];
  56. var netflix_proxies = netflix_proxy_configs[myseg % 2];
  57. var proxies = proxy_configs[myseg % 2];
  58.  
  59. if((/songza\.com\/(api|advertising)\/|hulu\.com\/mozart\/.*|\.(ico|jpg|png|gif|mp3|js|css|mp4|flv|swf|json)(\?.*)?$|^crackle\.com\/flash\/$/).test(url)||(/(^presentationtracking|blog|signup)\.netflix\.com$|^(r|p|t2|ll\.a|t|t-l3|ads|assets|urlcheck)\.hulu\.com$|^(stats|blog|audio.*|const.*|mediaserver.*|cont.*)\.pandora\.com$/).test(host)){
  60. return "DIRECT";
  61. }
  62.  
  63. if((/(^([\w\.-]+\.)?netflix|pandora\.com$)/).test(host)){
  64. return netflix_proxies;
  65. }
  66.  
  67.  
  68. // Or else connect directly:
  69. return "DIRECT";
  70. }
  71.  
  72. print (FindProxyForURL("http://i...content-available-to-author-only...t.com", "ironport.com"));
Runtime error #stdin #stdout #stderr 0.01s 4980KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
prog.js:8: ReferenceError: shExpMatch is not defined