HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Proxy Pac
Operating System - Linux
1828892
Members
2739
Online
109985
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2008 12:04 PM
05-19-2008 12:04 PM
Proxy Pac
Hi all i've a problem with proxy.pac squid.
My file is very easy but it does not work:
function FindProxyForURL(url, host)
{
if (isInNet(myIpAddress(),"172.22.24.0","255.255.255.0"))
return "PROXY 172.22.24.10:8080";
else
return "DIRECT";
}
Can anyone help me
Thanks
My file is very easy but it does not work:
function FindProxyForURL(url, host)
{
if (isInNet(myIpAddress(),"172.22.24.0","255.255.255.0"))
return "PROXY 172.22.24.10:8080";
else
return "DIRECT";
}
Can anyone help me
Thanks
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2008 05:14 PM
05-19-2008 05:14 PM
Re: Proxy Pac
It's been a very long time since I did these things, but I would have written it like this:
function FindProxyForURL(url, host)
{
if (isInNet(myIpAddress(), "172.22.24.0", "255.255.255.0")) {
return "PROXY 172.22.24.10:8080";
}
else {
return "DIRECT";
}
}
I am not 100% sure, but I seem to recall that the if...else structure was rather finicky about having the "extra" curly braces in there.
Note that this file is not related to the squid proxy itself at all: it's for configuring the web browsers, to make them use the proxy automatically when necessary.
You must place this file on some web server (not necessarily the proxy machine itself) so that the browsers can access it, and the web server must be configured to inform the browser that the MIME type of the .pac file is "application/x-ns-proxy-autoconfig".
You can use "lynx --dump --head" to verify that the MIME type of the file is configured correctly.
MK
function FindProxyForURL(url, host)
{
if (isInNet(myIpAddress(), "172.22.24.0", "255.255.255.0")) {
return "PROXY 172.22.24.10:8080";
}
else {
return "DIRECT";
}
}
I am not 100% sure, but I seem to recall that the if...else structure was rather finicky about having the "extra" curly braces in there.
Note that this file is not related to the squid proxy itself at all: it's for configuring the web browsers, to make them use the proxy automatically when necessary.
You must place this file on some web server (not necessarily the proxy machine itself) so that the browsers can access it, and the web server must be configured to inform the browser that the MIME type of the .pac file is "application/x-ns-proxy-autoconfig".
You can use "lynx --dump --head
MK
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2008 02:07 AM
05-20-2008 02:07 AM
Re: Proxy Pac
Hi and thanls for reply,
my proxy.pac is
function FindProxyForURL(url, host)
{
if (isInNet(myIpAddress(), "172.22.24.0", "255.255.255.0"))
return "PROXY 172.22.24.10:8080";
else
return "DIRECT";
}
It works correctly under my web server apache.
The lynx command results:
HTTP/1.1 200 OK
Date: Tue, 20 May 2008 10:05:35 GMT
Server: Apache/2.2.3 (Red Hat)
Last-Modified: Tue, 20 May 2008 10:02:13 GMT
ETag: "be525e-9c-92fff340"
Accept-Ranges: bytes
Content-Length: 156
Connection: close
Content-Type: application/x-ns-proxy-autoconfig
my proxy.pac is
function FindProxyForURL(url, host)
{
if (isInNet(myIpAddress(), "172.22.24.0", "255.255.255.0"))
return "PROXY 172.22.24.10:8080";
else
return "DIRECT";
}
It works correctly under my web server apache.
The lynx command results:
HTTP/1.1 200 OK
Date: Tue, 20 May 2008 10:05:35 GMT
Server: Apache/2.2.3 (Red Hat)
Last-Modified: Tue, 20 May 2008 10:02:13 GMT
ETag: "be525e-9c-92fff340"
Accept-Ranges: bytes
Content-Length: 156
Connection: close
Content-Type: application/x-ns-proxy-autoconfig
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP