Advertisement
Guest User

Proxy.pac

a guest
Oct 23rd, 2013
548
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function FindProxyForURL(url, host)
  2. {
  3. //Pass localhost traffic directly
  4. if ((host == "localhost") ||(shExpMatch(host, "localhost.*")) ||(host == "127.0.0.1")) {
  5. return "DIRECT";
  6. }
  7. //Pass local network traffic directly
  8. if (shExpMatch(host, "/^\d+\.\d+\.\d+\.\d+$/g")) {
  9. if (isInNet(host, "10.0.0.0", "255.0.0.0") {
  10. return "DIRECT";}      
  11. }
  12. //Test what it is seeing as local IP address
  13. if ((host =="proxy.mfrl.org")) {
  14. alert("Local IP address is: " + myIpAddress());
  15. }
  16. //Hostname without DNS Pass Directly
  17. if (isPlainHostName(host)){
  18. return "DIRECT";
  19. }
  20. //Proxy Server for Blacksburg Staff
  21. if (isInNet(myIpAddress(), "10.10.100.0", "255.255.255.0")){
  22. return "PROXY 10.10.100.12:8080";
  23. }
  24. ///Proxy Server for Christiansburg Staff
  25. if (isInNet(myIpAddress(), "10.10.110.0", "255.255.255.0")){
  26. return "PROXY 10.10.110.12:8080";
  27. }
  28. //Proxy Server for Floyd Staff
  29. if (isInNet(myIpAddress(), "10.10.120.0", "255.255.255.0")){
  30. return "PROXY 10.10.120.12:8080";
  31. }
  32. //Proxy Server for MPL Staff
  33. if (isInNet(myIpAddress(), "10.10.130.0", "255.255.255.0")){
  34. return "PROXY 10.10.130.12:8080";
  35. }
  36. //Proxy Server for Blacksburg Public
  37. if (isInNet(myIpAddress(), "10.30.100.0", "255.255.255.0")){
  38. return "PROXY 10.30.100.12:8080";
  39. }
  40. //Proxy Server for Christiansburg Public
  41. if (isInNet(myIpAddress(), "10.30.110.0", "255.255.255.0")){
  42. return "PROXY 10.30.110.12:8080";
  43. }
  44. //Proxy Server for Floyd Public
  45. if (isInNet(myIpAddress(), "10.30.120.0", "255.255.255.0")){
  46. return "PROXY 10.30.120.12:8080";
  47. }
  48. //Proxy Server for MPL Public
  49. if (isInNet(myIpAddress(), "10.30.130.0", "255.255.255.0")){
  50. return "PROXY 10.30.130.12:8080";
  51. }
  52. else
  53. return "DIRECT";
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement