Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for PAC files/URLs #17

Open
skulltech opened this issue Jun 2, 2017 · 3 comments
Open

Add support for PAC files/URLs #17

skulltech opened this issue Jun 2, 2017 · 3 comments

Comments

@skulltech
Copy link
Contributor

No description provided.

@jgsuess
Copy link

jgsuess commented Jun 25, 2019

Before I start: This is an awesome idea!
You might want to look at the proxy binary that comes with libproxy.

What you need to do this is:

  • install libproxy + tools (this will depend on your distro, yikes)
  • install libproxy plugin to parse WPAD (this will depend on your distro, yikes)

Call the libproxy interface as seen in the script below:

https://gitlab.com/jgsuess/poxy-proxy/blob/master/setproxy.bash

Important note: WPAD will compute proxy settings based on a URL you provide. This will effectively lead to a specific ProxyMan configuration for each URL-based query.

@6A61736F6E206E61646572
Copy link

@jgsuess Do you still have that script you linked above? Seems to be gone.

@jgsuess
Copy link

jgsuess commented Oct 28, 2019

if [ ! -n "$BASH" ]; then
    echo Please run this script $0 with bash; exit 1;
else

if (( $# != 2 ))
  then
    echo "This script will query the available PAC for the URL provided and set 
the http or https variables to the result."
    echo "Usage: source setproxy [http|https] URL"
    echo "Note you need to source the script, or else your parameters are not ex
ported."
fi

if ! [[ $1 =~ https? ]]; then
    echo "Parameter 1 (the proxy type to set) must be http or https."
fi

if ! [[ $2 =~ https?://.* ]]; then
    echo "Parameter 2 (the URL to obtain the proxy for) must be an http or https
 URL."
fi

export $1_proxy=`http_proxy=wpad:// proxy $2 | awk '{ print $2 }'`
echo "Proxy variables visible from this script:"
env | grep http

fi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants