// National Taiwan University Computer & Information Center // Automatic Proxy Configuration File // Commnets to master@proxy.ntu.edu.tw // URL http://proxy.ntu.edu.tw/pac/ntu.pac // IE got wrong implementation of dnsDomainIs(). // dnsDomainIs("com.my", ".com") is true... ?? Microsoft ..sigh // // NS and IE are not consistent on shExpMatch(). // shExpMatch("sun.COM", "*.com") IE return true, NS return false // so, make the "host" to lower case. // // IE 4.0 don't accept shExpMatch() function. // // 2001/1/8 use the string function // ckhuang function FindProxyForURL(url, host) { var lchost = host.toLowerCase(); // TANet domain and domains on peering ISP -- go DIRECT // if (withSuffix(lchost, "ntu.edu.tw")) { // return "PROXY 140.112.5.250:3128; " + // "DIRECT"; // } else if (isPlainHostName(host) || if (isPlainHostName(host) || // withSuffix(lchost, "tw") || withSuffix(lchost, "edu.tw") || withSuffix(lchost, "edu.tw.") || withPrefix(host, "140.112.") || withPrefix(host, "163.28.16.") || withSuffix(lchost, "hinet.net") || withSuffix(lchost, "pchome.com.tw") || withSuffix(lchost, "yam.com.tw") || withSuffix(lchost, "yam.com") || withSuffix(lchost, "kimo.com.tw") || withSuffix(lchost, "kimo.com") || withSuffix(lchost, "gigigaga.com.tw") || withSuffix(lchost, "gigigaga.com") || withSuffix(lchost, "giga.net.tw") || withSuffix(lchost, "ettoday.com.tw") || withSuffix(lchost, "ettoday.com") || withSuffix(lchost, "anet.net.tw") || withSuffix(lchost, "sina.com.tw") || withSuffix(lchost, "yes.net.tw") || withSuffix(lchost, "adver.com.tw") || withSuffix(lchost, "yuanta.com.tw") || contains(host, ",") || contains(host, "_") || contains(host, ";") ) { return "DIRECT"; } else if (isInNet(lchost, "10.0.0.0", "255.0.0.0") || isInNet(lchost, "192.168.0.0", "255.255.0.0")) { return "DIRECT"; // } else if (withSuffix(lchost, ".jp") || withSuffix(lchost, ".jp.") || // withSuffix(lchost, ".kr") || withSuffix(lchost, ".kr.") || // withSuffix(lchost, ".au") || withSuffix(lchost, ".au.") || // withSuffix(lchost, ".hk") || withSuffix(lchost, ".hk.") || // withSuffix(lchost, ".fr") || withSuffix(lchost, ".fr.") || // withSuffix(lchost, ".de") || withSuffix(lchost, ".de.") || // withSuffix(lchost, ".cn") || withSuffix(lchost, ".cn.") || // withSuffix(lchost, ".org") || withSuffix(lchost, ".org.") || // withSuffix(lchost, ".sg") || withSuffix(lchost, ".sg.") // ) { // return "PROXY 140.112.5.250:3128; " + // "PROXY 163.28.16.1:3128; " + // "DIRECT"; } else if ( dnsDomainIs(lchost,"computer.org")|| dnsDomainIs(lchost,"aacrjournals.org")|| dnsDomainIs(lchost,"aafp.org")|| dnsDomainIs(lchost,"aapt.org")|| dnsDomainIs(lchost,"aapjournals.org")|| dnsDomainIs(lchost,"aasldjournals.org")|| dnsDomainIs(lchost,"accesseric.org")|| dnsDomainIs(lchost,"acm.org")|| dnsDomainIs(lchost,"acs.org")|| dnsDomainIs(lchost,"ahajournals.org")|| dnsDomainIs(lchost,"aip.org")|| dnsDomainIs(lchost,"ajcn.org")|| dnsDomainIs(lchost,"ajkd.org")|| dnsDomainIs(lchost,"ama-assn.org")|| dnsDomainIs(lchost,"amjpathol.org")|| dnsDomainIs(lchost,"anb.org")|| dnsDomainIs(lchost,"anesthesia-analgesia.org")|| dnsDomainIs(lchost,"anesthesiology.org")|| dnsDomainIs(lchost,"annals.org")|| dnsDomainIs(lchost,"annualreviews.org")|| dnsDomainIs(lchost,"aps.org")|| dnsDomainIs(lchost,"apsnet.org")|| dnsDomainIs(lchost,"asce.org")|| dnsDomainIs(lchost,"ashp.org")|| dnsDomainIs(lchost,"asis.org")|| dnsDomainIs(lchost,"asm.org")|| dnsDomainIs(lchost,"asme.org")|| dnsDomainIs(lchost,"atsjournals.org")|| dnsDomainIs(lchost,"atvbaha.org")|| dnsDomainIs(lchost,"ieee.org")|| dnsDomainIs(lchost,"ieee-infocom.org")|| dnsDomainIs(lchost,"4spe.org")|| dnsDomainIs(lchost,"LWWmedicine.com")|| dnsDomainIs(lchost,"ahajournals.org")|| dnsDomainIs(lchost,"aidsonline.com")|| dnsDomainIs(lchost,"ajsp.com")|| dnsDomainIs(lchost,"alcoholism-cer.com")|| dnsDomainIs(lchost,"allenpress.com")|| dnsDomainIs(lchost,"amjclinicaloncology.com")|| dnsDomainIs(lchost,"amjdermatopathology.com")|| dnsDomainIs(lchost,"amjmedsci.com")|| dnsDomainIs(lchost,"ams.allenpress.com")|| dnsDomainIs(lchost,"ams.org")|| dnsDomainIs(lchost,"annalsofsurgery.com")|| dnsDomainIs(lchost,"annalsplasticsurgery.com")|| dnsDomainIs(lchost,"annalssurgicaloncology.com")|| dnsDomainIs(lchost,"ascepub.infor.com")|| dnsDomainIs(lchost,"aslib.co.uk")|| dnsDomainIs(lchost,"aspetjournals.org")|| dnsDomainIs(lchost,"bellhowell.infolearning.com")|| dnsDomainIs(lchost,"biochemj.org")|| dnsDomainIs(lchost,"bir.org.uk")|| dnsDomainIs(lchost,"blackwell-science.com")|| dnsDomainIs(lchost,"blackwell-synergy.com")|| dnsDomainIs(lchost,"blackwellpublishers.co.uk")|| dnsDomainIs(lchost,"bloodjournal.org")|| dnsDomainIs(lchost,"bmj.com")|| dnsDomainIs(lchost,"bmjjournals.com")|| dnsDomainIs(lchost,"bones.med.ohio-state.edu")|| dnsDomainIs(lchost,"cabi.org")|| dnsDomainIs(lchost,"cambridge.org")|| dnsDomainIs(lchost,"cancer.org")|| dnsDomainIs(lchost,"cancerhandbook.net")|| dnsDomainIs(lchost,"cardiosource.com")|| dnsDomainIs(lchost,"carl.org")|| dnsDomainIs(lchost,"cas.org")|| dnsDomainIs(lchost,"catchword.com")|| dnsDomainIs(lchost,"ccmjournal.com")|| dnsDomainIs(lchost,"cdc.gov")|| dnsDomainIs(lchost,"cell.com")|| dnsDomainIs(lchost,"cheme-a.umche.maine.edu")|| dnsDomainIs(lchost,"chemvillage.org")|| dnsDomainIs(lchost,"cios.org")|| dnsDomainIs(lchost,"circulationaha.org")|| dnsDomainIs(lchost,"circresaha.org")|| dnsDomainIs(lchost,"cjn.csis.com.tw")|| dnsDomainIs(lchost,"clinicalevidence.com")|| dnsDomainIs(lchost,"clinicalneuropharm.com")|| dnsDomainIs(lchost,"clinicalobgyn.com")|| dnsDomainIs(lchost,"clinicalpain.com")|| dnsDomainIs(lchost,"clinnephrol.com")|| dnsDomainIs(lchost,"clinpulm.com")|| dnsDomainIs(lchost,"clorinda.catchword.com")|| dnsDomainIs(lchost,"cna.com.tw")|| dnsDomainIs(lchost,"co-anesthesiology.com")|| dnsDomainIs(lchost,"co-hematology.com")|| dnsDomainIs(lchost,"corneajrnl.com")|| dnsDomainIs(lchost,"coronary-artery.com")|| dnsDomainIs(lchost,"corronline.com")|| dnsDomainIs(lchost,"countrydata.bvdep.com")|| dnsDomainIs(lchost,"csa.com.tw")|| dnsDomainIs(lchost,"csis.com.tw")|| dnsDomainIs(lchost,"cup.org")|| dnsDomainIs(lchost,"current-biology.com")|| dnsDomainIs(lchost,"dataswetsconnect.com")|| dnsDomainIs(lchost,"dbs.lib.ntu.edu.tw")|| dnsDomainIs(lchost,"degruyter.com")|| dnsDomainIs(lchost,"dekker.com")|| dnsDomainIs(lchost,"developmentalcell.com")|| dnsDomainIs(lchost,"dictionary.oed.com")|| dnsDomainIs(lchost,"digisle.net")|| dnsDomainIs(lchost,"download.current-biology.com")|| dnsDomainIs(lchost,"download.developmentalcell.com")|| dnsDomainIs(lchost,"download.immunity.com")|| dnsDomainIs(lchost,"dukemathjournal.org")|| dnsDomainIs(lchost,"ebsco.com")|| dnsDomainIs(lchost,"ed.gov")|| dnsDomainIs(lchost,"edpsciences.com")|| dnsDomainIs(lchost,"ehis.niehs.nih.gov")|| dnsDomainIs(lchost,"ei.org")|| dnsDomainIs(lchost,"ei.e-lib.nctu.edu.tw")|| dnsDomainIs(lchost,"ei.stic.gov.tw")|| dnsDomainIs(lchost,"eiu.com")|| dnsDomainIs(lchost,"eje.org")|| dnsDomainIs(lchost,"ejournals.worldscientific.com.sg")|| dnsDomainIs(lchost,"electrochem.org")|| dnsDomainIs(lchost,"ellispub.com")|| dnsDomainIs(lchost,"els.net")|| dnsDomainIs(lchost,"elsevier.co.jp")|| dnsDomainIs(lchost,"elsevier.com")|| dnsDomainIs(lchost,"elsevier.nl")|| dnsDomainIs(lchost,"embase.com")|| dnsDomainIs(lchost,"emboj.org")|| dnsDomainIs(lchost,"emerald-library.com")|| dnsDomainIs(lchost,"emeraldinsight.com")|| dnsDomainIs(lchost,"ency-astro.com")|| dnsDomainIs(lchost,"ency-japan.com")|| dnsDomainIs(lchost,"endocrinology.org")|| dnsDomainIs(lchost,"envplan.com")|| dnsDomainIs(lchost,"epnet.com")|| dnsDomainIs(lchost,"erl.sinica.edu.tw:8590")|| dnsDomainIs(lchost,"erl.sinica.edu.tw:8595")|| dnsDomainIs(lchost,"eshaman.com")|| dnsDomainIs(lchost,"fasebj.org")|| dnsDomainIs(lchost,"fcla.edu")|| dnsDomainIs(lchost,"frymulti.com")|| dnsDomainIs(lchost,"futuraco.com")|| dnsDomainIs(lchost,"galegroup.com")|| dnsDomainIs(lchost,"galenet.galegroup.com")|| dnsDomainIs(lchost,"ovid.com")|| dnsDomainIs(lchost,"genesdev.org")|| dnsDomainIs(lchost,"genetics.org")|| dnsDomainIs(lchost,"genomebiology.com")|| dnsDomainIs(lchost,"geosociety.org")|| dnsDomainIs(lchost,"gepref.gep.ncu.edu.tw")|| dnsDomainIs(lchost,"globalbooksinprint.com")|| dnsDomainIs(lchost,"grolier.com")|| dnsDomainIs(lchost,"groveart.com")|| dnsDomainIs(lchost,"grovemusic.com")|| dnsDomainIs(lchost,"harcourt-international.com")|| dnsDomainIs(lchost,"harrisonsonline.com")|| dnsDomainIs(lchost,"HighWire.org")|| dnsDomainIs(lchost,"hindawi.co.uk")|| dnsDomainIs(lchost,"hindawi.com")|| dnsDomainIs(lchost,"hosppract.com")|| dnsDomainIs(lchost,"hppmusicindex.com")|| dnsDomainIs(lchost,"hsl-proxy.med.ohio-state.edu")|| dnsDomainIs(lchost,"hypertensionaha.org")|| dnsDomainIs(lchost,"idealibrary.com")|| dnsDomainIs(lchost,"imaging.org")|| dnsDomainIs(lchost,"immunity.com")|| dnsDomainIs(lchost,"inca.math.indiana.edu")|| dnsDomainIs(lchost,"informs.org")|| dnsDomainIs(lchost,"ingenta.com")|| dnsDomainIs(lchost,"ingentaselect.com")|| dnsDomainIs(lchost,"iospress.metapress.com")|| dnsDomainIs(lchost,"iospress.nl")|| dnsDomainIs(lchost,"isi.digilib.nctu.edu.tw")|| dnsDomainIs(lchost,"isiknowledge.com")|| dnsDomainIs(lchost,"isilinks.com")|| dnsDomainIs(lchost,"itsmarc.com")|| dnsDomainIs(lchost,"iucr.org")|| dnsDomainIs(lchost,"jama.com")|| dnsDomainIs(lchost,"jasn.org")|| dnsDomainIs(lchost,"jcb.org")|| dnsDomainIs(lchost,"jci.org")|| dnsDomainIs(lchost,"jco.org")|| dnsDomainIs(lchost,"jbjs.kfinder.com")|| dnsDomainIs(lchost,"jchemed.chem.wisc.edu")|| dnsDomainIs(lchost,"jcrweb.com")|| dnsDomainIs(lchost,"jem.org")|| dnsDomainIs(lchost,"jgp.org")|| dnsDomainIs(lchost,"jimmunol.org")|| dnsDomainIs(lchost,"jlr.org")|| dnsDomainIs(lchost,"jneurosci.org")|| dnsDomainIs(lchost,"jobspectrum.com")|| dnsDomainIs(lchost,"journals.cup.org")|| dnsDomainIs(lchost,"journals.uchicago.edu")|| dnsDomainIs(lchost,"journals.wspc.com.sg")|| dnsDomainIs(lchost,"jphysiol.org")|| dnsDomainIs(lchost,"jrf-journals.org.uk")|| dnsDomainIs(lchost,"jstor1.mcc.ac.uk")|| dnsDomainIs(lchost,"jstor.org")|| dnsDomainIs(lchost,"jurology.com")|| dnsDomainIs(lchost,"kluweronline.com")|| dnsDomainIs(lchost,"lexis-nexis.com")|| dnsDomainIs(lchost,"lexis.com")|| dnsDomainIs(lchost,"link.springer-ny.com")|| dnsDomainIs(lchost,"link.springer.de")|| dnsDomainIs(lchost,"lisanet.co.uk")|| dnsDomainIs(lchost,"lrponline.com")|| dnsDomainIs(lchost,"lww.com")|| dnsDomainIs(lchost,"lwwoncology.com")|| dnsDomainIs(lchost,"lwwonline.com")|| dnsDomainIs(lchost,"maik.maik.rssi.ru")|| dnsDomainIs(lchost,"math.ucdavis.edu")|| dnsDomainIs(lchost,"mdconsult.com")|| dnsDomainIs(lchost,"mitpress.mit.edu")|| dnsDomainIs(lchost,"molbiolevol.org")|| dnsDomainIs(lchost,"molecule.org")|| dnsDomainIs(lchost,"mosby.com")|| dnsDomainIs(lchost,"muse.jhu.edu")|| dnsDomainIs(lchost,"mvstcp1.swets.nl")|| dnsDomainIs(lchost,"nature.com")|| dnsDomainIs(lchost,"naturereference.com")|| dnsDomainIs(lchost,"naturesj.com")|| dnsDomainIs(lchost,"nber.org")|| dnsDomainIs(lchost,"ncbi.nlm.nih.gov")|| dnsDomainIs(lchost,"nejm.org")|| dnsDomainIs(lchost,"net.nih.gov")|| dnsDomainIs(lchost,"netra.newsbank.com")|| dnsDomainIs(lchost,"neurology.org")|| dnsDomainIs(lchost,"neuron.org")|| dnsDomainIs(lchost,"neurosurgery-online.com")|| dnsDomainIs(lchost,"nutrition.org")|| dnsDomainIs(lchost,"newton.ioppublishing.com")|| dnsDomainIs(lchost,"nuclearmed.com")|| dnsDomainIs(lchost,"oclc.org")|| dnsDomainIs(lchost,"ohiolink.edu")|| dnsDomainIs(lchost,"opticsinfobase.org")|| dnsDomainIs(lchost,"osa.org")|| dnsDomainIs(lchost,"otology-neurotology.org")|| dnsDomainIs(lchost,"oup.co.uk")|| dnsDomainIs(lchost,"oupjournals.org")|| dnsDomainIs(lchost,"ovid.com")|| dnsDomainIs(lchost,"password.pcift.chadwyck.com")|| dnsDomainIs(lchost,"pci.chadwyck.co.uk")|| dnsDomainIs(lchost,"pci.chadwyck.com")|| dnsDomainIs(lchost,"pcift.chadwyck.co.uk")|| dnsDomainIs(lchost,"pcift.chadwyck.com")|| dnsDomainIs(lchost,"pcift.global.chadwyck.co.uk")|| dnsDomainIs(lchost,"pediatrics.org")|| dnsDomainIs(lchost,"pedresearch.org")|| dnsDomainIs(lchost,"perio.org")|| dnsDomainIs(lchost,"physiology.org")|| dnsDomainIs(lchost,"phytoparasitica.org")|| dnsDomainIs(lchost,"plasreconsurg.org")|| dnsDomainIs(lchost,"pnas.org")|| dnsDomainIs(lchost,"portlandpress.com")|| dnsDomainIs(lchost,"pqdd.sinica.edu.tw")|| dnsDomainIs(lchost,"psychiatrist.com")|| dnsDomainIs(lchost,"psychiatryonline.org")|| dnsDomainIs(lchost,"publish.csiro.au")|| dnsDomainIs(lchost,"ramiro.catchword.com")|| dnsDomainIs(lchost,"readopac.ncl.edu.tw")|| dnsDomainIs(lchost,"rep.routledge.com")|| dnsDomainIs(lchost,"root.com.tw")|| dnsDomainIs(lchost,"rsc.org")|| dnsDomainIs(lchost,"rsnajnls.org")|| dnsDomainIs(lchost,"schattauer.de")|| dnsDomainIs(lchost,"sciencedirect.com")|| dnsDomainIs(lchost,"sciencemag.org")|| dnsDomainIs(lchost,"ejournal.ascc.net")|| dnsDomainIs(lchost,"www.sciam.com")|| dnsDomainIs(lchost,"sdos.sinica.edu.tw")|| dnsDomainIs(lchost,"services.lww.com")|| dnsDomainIs(lchost,"sgmjournals.org")|| dnsDomainIs(lchost,"siam.org")|| dnsDomainIs(lchost,"simmons.edu")|| dnsDomainIs(lchost,"sitis.org.tw")|| dnsDomainIs(lchost,"socgenmicrobio1.org.uk")|| dnsDomainIs(lchost,"spie.org")|| dnsDomainIs(lchost,"spinejournal.com")|| dnsDomainIs(lchost,"springer-ny.com")|| dnsDomainIs(lchost,"stanford.edu")|| dnsDomainIs(lchost,"statref.com")|| dnsDomainIs(lchost,"stic.gov.tw")|| dnsDomainIs(lchost,"swetsblackwell.com")|| dnsDomainIs(lchost,"swetsnet.nl")|| dnsDomainIs(lchost,"swetsnetnavigator.nl")|| dnsDomainIs(lchost,"swetswise.com")|| dnsDomainIs(lchost,"t-telford.com")|| dnsDomainIs(lchost,"tandf.co.uk")|| dnsDomainIs(lchost,"taylorandfrancis.metapress.com")|| dnsDomainIs(lchost,"tbmc.com.tw")|| dnsDomainIs(lchost,"thejns-net.org")|| dnsDomainIs(lchost,"thelancet.com")|| dnsDomainIs(lchost,"transfusion.org")|| dnsDomainIs(lchost,"turpion.org")|| dnsDomainIs(lchost,"twp.apipa.org.tw")|| dnsDomainIs(lchost,"u1200b.economist.com")|| dnsDomainIs(lchost,"udndata.com")|| dnsDomainIs(lchost,"uidaho.edu")|| dnsDomainIs(lchost,"uli.org")|| dnsDomainIs(lchost,"ulrichsweb.com")|| dnsDomainIs(lchost,"umi.com")|| dnsDomainIs(lchost,"umich.edu")|| dnsDomainIs(lchost,"uscapjournals.org")|| dnsDomainIs(lchost,"usenix.edu")|| dnsDomainIs(lchost,"w3.org")|| dnsDomainIs(lchost,"wbsaunders.com")|| dnsDomainIs(lchost,"web.bma.org.uk")|| dnsDomainIs(lchost,"webofscience.com")|| dnsDomainIs(lchost,"wiley.com")|| dnsDomainIs(lchost,"wkap.nl")|| dnsDomainIs(lchost,"worldmarketsanalysis.com")|| dnsDomainIs(lchost,"wos.isitrial.com")|| dnsDomainIs(lchost,"wsj.com")|| dnsDomainIs(lchost,"www-fourier.ujf-grenoble.fr")|| dnsDomainIs(lchost,"www2.uspto.gov")|| isInNet(host,"140.115.20.67", "255.255.255.255")|| isInNet(host,"163.29.141.191", "255.255.255.255")|| isInNet(host,"195.226.52.174", "255.255.255.255")|| isInNet(host,"203.74.36.75", "255.255.255.255")|| isInNet(host,"207.202.74.10", "255.255.255.255")|| isInNet(host,"210.69.89.224", "255.255.255.255") ) { return "PROXY 140.112.1.98:3128; " + "DIRECT"; // } else if (url.substring(0, 6) == "https:") { // return "PROXY 163.28.16.9:3128; " + // "PROXY 163.28.16.5:3128; " + // "DIRECT"; // } else if (url.substring(0, 4) == "ftp:") { // return "PROXY 163.28.16.7:3128; " + // "PROXY 163.28.16.5:3128; " + // "PROXY 163.28.16.9:3128; " + // "DIRECT"; } else if (withSuffix(lchost, ".tw") || withSuffix(lchost, ".tw.")) { return "PROXY 140.112.1.98:3128; " + // return "PROXY 163.28.16.4:3128; " + // "PROXY 163.28.16.5:3128; " + // "PROXY 163.28.16.9:3128; " + "DIRECT"; } else if (withSuffix(lchost, ".com") || withSuffix(lchost, ".com.")) { // } else if (inRangeDomain(lchost, "a-m", ".com")) { return "PROXY 140.112.1.98:3128; " + // return "PROXY 163.28.16.2:3128; " + // "PROXY 163.28.16.2:3128; " + // "PROXY 163.28.16.9:3128; " + "DIRECT"; } else { return "PROXY 140.112.1.98:3128; " + // return "PROXY 163.28.16.1:3128; " + // "PROXY 163.28.16.1:3128; " + // "PROXY 163.28.16.5:3128; " + "DIRECT"; } } function withPrefix(str, prefix) { return (str.indexOf(prefix) == 0); } function withSuffix(str, suffix) { var n = str.lastIndexOf(suffix); return (n >= 0 && n + suffix.length == str.length); } function contains(str, tok) { return (str.indexOf(tok) > 0); } function inDomain(str, postfix) { var n = str.lastIndexOf(postfix); return (n >= 0 && n + postfix.length == str.length); } function getFirstChar(host,postfix) { var ret = -1; var i, n; if(inDomain(host, postfix)) { n = host.substring(0, host.lastIndexOf(postfix)); if ( (i=n.lastIndexOf(".")) != -1) { ret = n.substring(i+1, i+2); } else { ret = n.charAt(0); } return ret; } else { return ret; } } function inRangeDomain(host, range, postfix) { var az="0123456789abcdefghijklmnopqrstuvwxyz"; var first, last, key, tmp; tmp = az.indexOf(range.charAt(2)); last = az.charAt(tmp); tmp = az.indexOf(range.charAt(0)); first = az.charAt(tmp); key = getFirstChar(host, postfix); if(key <= last && key >= first) { return true; } else { return false; } return false; }