จากตัวอย่างผมใช้ DHCP server ของ window 2008r2
*อย่าลืมว่าที่ browser ต้อง set auto ด้วยนะครับ
ขั้นตอนการเตรียม wpad.dat
- File wpad.dat คือ File ที่มีรายละเอียดของ Proxy อยู่ภายใน File นี้สามารถกำหนดว่าจะให้ใช้ proxy กับเว็บไหน หรือ ip ไหนก็ได้ หรือจะเลือกว่า เว็บไหนให้ใช้ proxy ตัวไหนก็ได้
- ตัวอย่าง
function FindProxyForURL(url, host) { //check for local domains if (dnsDomainIs(host,"*.domain.co.th")) {return "DIRECT";} if (dnsDomainIs(host,"*.domain.local")) {return "DIRECT";} //check for local IP addresses if ((shExpMatch(host,"127.0.0.1")) || (shExpMatch(host,"192.168.11.*")) // Enter you local IP subnets ) {return "DIRECT";} //check for short host names if (isPlainHostName(host)) {return "DIRECT";} //else return proxy return "PROXY proxy.trueinternet.co.th:8080"; }
วิเคราะห์ทีล่ะบรรทัด
if (dnsDomainIs(host,"*.domain.co.th")) {return "DIRECT";}
หมายถึง ถ้าเป็น "*.domain.co.th" ไม่ต้องใช้ Proxy ให้ตรงไปที่เว็บได้เลย
if ((shExpMatch(host,"127.0.0.1")) || (shExpMatch(host,"192.168.11.*")) // Enter you local IP subnets ) {return "DIRECT";}
หมายถึง ถ้าเป็น network ip 127.0.0.1 และ 192.168.11.0 ให้ตรงไปได้เลย
return "PROXY proxy.trueinternet.co.th:8080";
หมายถึง
เว็บอื่นๆให้ใช้ Proxy ที่ proxy.trueinternet.co.th:8080
-NINJANAJA-
ไม่มีความคิดเห็น:
แสดงความคิดเห็น