{"id":1693,"date":"2013-03-05T17:01:46","date_gmt":"2013-03-05T17:01:46","guid":{"rendered":"http:\/\/www.edwardsd.co.uk\/work\/?p=1693"},"modified":"2013-03-06T14:52:59","modified_gmt":"2013-03-06T14:52:59","slug":"pac-file-example","status":"publish","type":"post","link":"https:\/\/www.edwardsd.co.uk\/work\/2013\/03\/pac-file-example\/","title":{"rendered":".PAC File Example"},"content":{"rendered":"<p>Basic PAC file configuration. The browser can be configured to point to this file (proxy.pac) in order to direct the browser traffic to the correct Gateway Proxy server. The path can be configured to use a public URL such as http:\/\/proxy.domain.com\/_proxy\/proxy.pac.<\/p>\n<p><strong><em>Internet Explorer -&gt; Tools -&gt; Internet Options -&gt; Connections -&gt; LAN Settings -&gt; Automatic Configuration -&gt; Use Automatic configuration script<\/em><\/strong><\/p>\n<p><a title=\"How to configure Internet Explorer to use a proxy server\" href=\"http:\/\/support.microsoft.com\/kb\/135982\" target=\"_blank\">http:\/\/support.microsoft.com\/kb\/135982<\/a><\/p>\n<p><!--more--><\/p>\n<pre lang=\"basic\">\/\/ Notes in this section\r\n\/\/ This is a PAC file which allows I.E. (or Firefox) to direct the traffic to the correct Proxy server. \r\n\r\nfunction FindProxyForURL(url, host)\r\n{\r\n\/*\r\nInternal IP address ranges:\r\n192.168.1.0 -London\r\n192.168.2.0 -Paris\r\n192.168.3.0 -New York\r\n*\/\r\n\r\nif\r\n(\r\nhost == \"localhost\"\r\n||\r\nshExpMatch(host, \"localhost.*\")\r\n||\r\nisPlainHostName(host)\r\n||\r\nisInNet(host, \"127.0.0.0\", \"255.0.0.0\")\r\n||\r\nisInNet(host, \"192.168.1.0\", \"255.255.255.0\")\r\n||\r\nisInNet(host, \"192.168.2.0\", \"255.255.255.0\")\r\n||\r\nisInNet(host, \"192.168.3.0\", \"255.255.255.0\")\r\n)\r\n{\r\nreturn \"DIRECT\";\r\n}\r\n\r\n\/*\r\nProxy exceptions comment section, you can list \r\nURLs which require proxy exceptions\/bypass here.\r\n- NoProxyBankingSite1.co.uk\r\n- NoProxyBankingSite2.co.uk\r\n- 10.10.10.10\r\n*\/\r\n(\r\ndnsDomainIs(host, \"NoProxyBankingSite1.co.uk\")\r\n||\r\ndnsDomainIs(host, \"NoProxyBankingSite2.co.uk\")\r\n||\r\nshExpMatch(url, \"*10.10.10.10*\")\r\n)\r\n{\r\nreturn \"DIRECT\";\r\n}\r\n\r\nif (isInNet(myIpAddress(),\"192.168.1.0\",\"255.255.255.0\"))\r\n{\r\nreturn \"PROXY 192.168.1.253:8080\";\r\n}\r\nif (isInNet(myIpAddress(),\"192.168.2.0\",\"255.255.255.0\"))\r\n{\r\nreturn \"PROXY 192.168.2.253:8080\";\r\n}\r\n\r\nreturn \"DIRECT\";\r\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Basic PAC file configuration. The browser can be configured to point to this file (proxy.pac) in order to direct the browser traffic to the correct Gateway Proxy server. The path can be configured to use a public URL such as http:\/\/proxy.domain.com\/_proxy\/proxy.pac. Internet Explorer -&gt; Tools -&gt; Internet Options -&gt; Connections -&gt; LAN Settings -&gt; Automatic [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[21,26],"tags":[],"class_list":["post-1693","post","type-post","status-publish","format-standard","hentry","category-code","category-internet-explorer"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pOPt8-rj","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.edwardsd.co.uk\/work\/wp-json\/wp\/v2\/posts\/1693","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.edwardsd.co.uk\/work\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.edwardsd.co.uk\/work\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.edwardsd.co.uk\/work\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.edwardsd.co.uk\/work\/wp-json\/wp\/v2\/comments?post=1693"}],"version-history":[{"count":0,"href":"https:\/\/www.edwardsd.co.uk\/work\/wp-json\/wp\/v2\/posts\/1693\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.edwardsd.co.uk\/work\/wp-json\/wp\/v2\/media?parent=1693"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.edwardsd.co.uk\/work\/wp-json\/wp\/v2\/categories?post=1693"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.edwardsd.co.uk\/work\/wp-json\/wp\/v2\/tags?post=1693"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}