test.js 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. function FindProxyForURL(url, host) {
  2. host = host.toLowerCase();
  3. url = url.toLowerCase();
  4. if (dnsDomainIs(host, 'test.com')) {
  5. return 'PROXY 123.123.123.123:8080';
  6. } else if (dnsDomainIs(host, 'yunbusiness.ccb.com')) {
  7. return 'PROXY 106.52.252.45:25010';
  8. } else if (dnsDomainIs(host, 'piaocmb.o2o.cmbchina.com')) {
  9. return 'PROXY 106.52.252.45:25010';
  10. } else if (dnsDomainIs(host, 'icbc.opapp.cn')) {
  11. return 'PROXY 106.52.252.45:25010';
  12. } else if (dnsDomainIs(host, 'piaorush.o2o.cmbchina.com')) {
  13. return 'PROXY 106.52.252.45:25010';
  14. } else if (dnsDomainIs(host, 'piao-json-cdn.o2o.cmbchina.com')) {
  15. return 'PROXY 106.52.252.45:25010';
  16. } else if (dnsDomainIs(host, 'fpwx.o2o.cmbchina.com')) {
  17. return 'PROXY 106.52.252.45:25010';
  18. } else if (dnsDomainIs(host, 'ccpay.cib.com.cn')) {
  19. return 'PROXY 106.52.252.45:25010';
  20. } else if (dnsDomainIs(host, 'psbc.huajifen.com')) {
  21. return 'PROXY 106.52.252.45:25010';
  22. } else if (dnsDomainIs(host, 'gdecard.jiahuaming.com')) {
  23. return 'PROXY 106.52.252.45:25010';
  24. } else if (dnsDomainIs(host, 'mall.abchina.com')) {
  25. return 'PROXY 106.52.252.45:25010';
  26. } else if (dnsDomainIs(host, 'm.ujia007.com')) {
  27. return 'PROXY 106.52.252.45:25010';
  28. } else if (dnsDomainIs(host, 'creditcardapp.bankcomm.com')) {
  29. return 'PROXY 106.52.252.45:25010';
  30. } else if (dnsDomainIs(host, 'mall.creditcard.gzcb.com.cn')) {
  31. return 'PROXY 106.52.252.45:25010';
  32. } else if (dnsDomainIs(host, 'vtravel.link2shops.com')) {
  33. return 'PROXY 106.52.252.45:25010';
  34. } else if (dnsDomainIs(host, 'uop.amexpressnetwork.com')) {
  35. return 'PROXY 106.52.252.45:25010';
  36. } else if (dnsDomainIs(host, 'mapi-seckill.bestpay.com.cn')) {
  37. return 'PROXY 106.52.252.45:25010';
  38. } else if (dnsDomainIs(host, 'piaorush.o2o.cmbchina.com')) {
  39. return 'PROXY 106.52.252.45:25010';
  40. } else if (dnsDomainIs(host, 'piao-json-cdn.o2o.cmbchina.com')) {
  41. return 'PROXY 106.52.252.45:25010';
  42. } else if (dnsDomainIs(host, 'fpwx.o2o.cmbchina.com')) {
  43. return 'PROXY 106.52.252.45:25010';
  44. } else if (dnsDomainIs(host, 'm.client.10010.com')) {
  45. return 'PROXY 106.52.252.45:25010';
  46. } else if (dnsDomainIs(host, 'aaph.nbcb.com.cn')) {
  47. return 'PROXY 106.52.252.45:25010';
  48. } else if (dnsDomainIs(host, 'api.shoppingm.cn')) {
  49. return 'PROXY 106.52.252.45:25010';
  50. } else if (dnsDomainIs(host, 'wzapi.oywanhao.com')) {
  51. return 'PROXY 106.52.252.45:25010';
  52. } else if (dnsDomainIs(host, 'hemi.lianhaikeji.com')) {
  53. return 'PROXY 106.52.252.45:25010';
  54. } else if (dnsDomainIs(host, 'static.lianhaikeji.com')) {
  55. return 'PROXY 106.52.252.45:25010';
  56. } else if (dnsDomainIs(host, 'hz.qyfw168.cn')) {
  57. return 'PROXY 106.52.252.45:25010';
  58. } else if (dnsDomainIs(host, 'appsmall.rtmap.com')) {
  59. return 'PROXY 106.52.252.45:25010';
  60. } else if (dnsDomainIs(host, 'www.mcearnmore.com')) {
  61. return 'PROXY 106.52.252.45:25010';
  62. } else if (dnsDomainIs(host, 'm.mallcoo.cn')) {
  63. return 'PROXY 106.52.252.45:25010';
  64. } else if (dnsDomainIs(host, 'mall.nbcb.com.cn')) {
  65. return 'PROXY 106.52.252.45:25010';
  66. } else if (dnsDomainIs(host, 'delivery.aeonbuy.com')) {
  67. return 'PROXY 106.52.252.45:25010';
  68. } else if (dnsDomainIs(host, 'g.qll-times.com')) {
  69. return 'PROXY 106.52.252.45:25010';
  70. } else if (dnsDomainIs(host, 'api.jifenfu.net')) {
  71. return 'PROXY 106.52.252.45:25010';
  72. } else if (dnsDomainIs(host, 'h5.schengle.com')) {
  73. return 'PROXY 106.52.252.45:25010';
  74. } else if (dnsDomainIs(host, 'bnb.rongdatamall.com')) {
  75. return 'PROXY 106.52.252.45:25010';
  76. } else if (dnsDomainIs(host, 'chuxinget.fpsd.unionpay.com')) {
  77. return 'PROXY 106.52.252.45:25010';
  78. } else if (dnsDomainIs(host, 'marketing.bulk-delivery.com')) {
  79. return 'PROXY 106.52.252.45:25010';
  80. } else if (dnsDomainIs(host, 'wypwfw.xsy365.com.cn')) {
  81. return 'PROXY 106.52.252.45:25010';
  82. } else if (dnsDomainIs(host, 'fw.qyfw168.cn')) {
  83. return 'PROXY 106.52.252.45:25010';
  84. } else if (dnsDomainIs(host, '94828.activity-35.m.duiba.com.cn')) {
  85. return 'PROXY 106.52.252.45:25010';
  86. } else if (dnsDomainIs(host, 'aaph.nbcb.com.cn')) {
  87. return 'PROXY 106.52.252.45:25010';
  88. } else if (dnsDomainIs(host, 'market-web.ofpay.com')) {
  89. return 'PROXY 106.52.252.45:25010';
  90. } else if (dnsDomainIs(host, 'service.jifenfu.net')) {
  91. return 'PROXY 106.52.252.45:25010';
  92. } else if (dnsDomainIs(host, 'vip.octharbour.com')) {
  93. return 'PROXY 106.52.252.45:25010';
  94. } else if (dnsDomainIs(host, 'crm.scpgroup.com.cn')) {
  95. return 'PROXY 106.52.252.45:25010';
  96. } else if (dnsDomainIs(host, 'mtp.creditcard.ecitic.com')) { return 'PROXY 106.52.252.45:25010'; } else if (dnsDomainIs(host, 'rushbuy.creditcard.ecitic.com')) { return 'PROXY 106.52.252.45:25010'; } else if (dnsDomainIs(host, 'wx.abchina.com')) { return 'PROXY 106.52.252.45:25010'; } else if (dnsDomainIs(host, 'mrp.creditcard.hxb.com.cn')) { return 'PROXY 106.52.252.45:25010'; } else if (dnsDomainIs(host, 'api.m.jd.com')) { return 'PROXY 106.52.252.45:25010'; } else if (dnsDomainIs(host, 'prodev.m.jd.com')) { return 'PROXY 106.52.252.45:25010'; } else if (dnsDomainIs(host, 'promotion.waimai.meituan.com')) { return 'PROXY 106.52.252.45:25010'; } else if (dnsDomainIs(host, 'activitymanual.epaynfc.com')) { return 'PROXY 106.52.252.45:25010'; } else if (dnsDomainIs(host, 'ebusiness.bzh001.com')) { return 'PROXY 106.52.252.45:25010'; } else if (dnsDomainIs(host, 'yx.all-pay.cn')) { return 'PROXY 106.52.252.45:25010'; } else if (dnsDomainIs(host, 'w.all-pay.cn')) { return 'PROXY 106.52.252.45:25010'; } else if (dnsDomainIs(host, 'icbc.rellux.com.cn')) { return 'PROXY 106.52.252.45:25010'; } else if (dnsDomainIs(host, 'ilike-cloud-mapi.zmaxfilm.com')) { return 'PROXY 106.52.252.45:25010'; } else if (dnsDomainIs(host, 'coin.abchina.com')) { return 'PROXY 106.52.252.45:25010'; } else if (dnsDomainIs(host, 'ldp.creditcard.ecitic.com')) { return 'PROXY 106.52.252.45:25010'; } else if (dnsDomainIs(host, 'wxapi.m.taopiaopiao.com')) { return 'PROXY 106.52.252.45:25010'; } else if (dnsDomainIs(host, 'hbp-prod.fenlekeji.com')) { return 'PROXY 106.52.252.45:25010'; } else { return 'DIRECT'; }
  97. }
  98. let base64DecodeChars = new Array(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1);
  99. /**
  100. * base64编码
  101. * @param {Object} str
  102. */
  103. function base64encode(str){
  104. let base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  105. let out, i, len;
  106. let c1, c2, c3;
  107. len = str.length;
  108. i = 0;
  109. out = "";
  110. while (i < len) {
  111. c1 = str.charCodeAt(i++) & 0xff;
  112. if (i == len) {
  113. out += base64EncodeChars.charAt(c1 >> 2);
  114. out += base64EncodeChars.charAt((c1 & 0x3) << 4);
  115. out += "==";
  116. break;
  117. }
  118. c2 = str.charCodeAt(i++);
  119. if (i == len) {
  120. out += base64EncodeChars.charAt(c1 >> 2);
  121. out += base64EncodeChars.charAt(((c1 & 0x3) << 4) | ((c2 & 0xF0) >> 4));
  122. out += base64EncodeChars.charAt((c2 & 0xF) << 2);
  123. out += "=";
  124. break;
  125. }
  126. c3 = str.charCodeAt(i++);
  127. out += base64EncodeChars.charAt(c1 >> 2);
  128. out += base64EncodeChars.charAt(((c1 & 0x3) << 4) | ((c2 & 0xF0) >> 4));
  129. out += base64EncodeChars.charAt(((c2 & 0xF) << 2) | ((c3 & 0xC0) >> 6));
  130. out += base64EncodeChars.charAt(c3 & 0x3F);
  131. }
  132. return out;
  133. }