1
I Use This!
Low Activity
Analyzed 1 day ago. based on code collected 1 day ago.

Project Summary

pacparser is a library to parse proxy auto-config (PAC) files. Proxy auto-config files are a vastly used proxy configuration method these days. Web browsers can use a PAC file to determine which proxy server to use or whether to go direct for a given URL. PAC files are written in JavaScript and can be programmed to return different proxy methods (e.g. "PROXY proxy1:port; DIRECT") depending upon URL, source IP address, protocol, time of the day etc. PAC files introduce a lot of possibilities. Look at the wikipedia link above to find out more about them.

Needless to say, PAC files are now a widely accepted method for proxy configuration management and companies all over are using them in corporate environment. Almost all popular web browsers support PAC files. The idea behind pacparser is to make it easy to add this PAC file parsing capability to any program (C and python supported right now). It comes as a shared C library and a python module which can be used to make any C or python program PAC scripts intelligent. Some very useful targets could be popular web software like wget, curl and python-urllib.

Please look at the README and other links for more information.

Usage ExamplesUsing it with python:

>>> import pacparser
>>> pacparser.init()
>>> pacparser.parse_pac('examples/wpad.dat')
>>> pacparser.find_proxy('http://www.google.com', 'www.google.com')
'PROXY proxy1.manugarg.com:3128; PROXY proxy2.manugarg.com:3128; DIRECT'
>>> pacparser.find_proxy('http://www2.manugarg.com', 'www2.manugarg.com')
'DIRECT'
>>> pacparser.cleanup()
>>>Using it in C:

manugarg@hobbiton:~$ cat pactest.c
#include

int pacparser_init();
int pacparser_parse_pac(char* pacfile);
char *pacparser_find_proxy(char *url, char *host);
void pacparser_cleanup();

int main(int argc, char* argv[])
{
char *proxy;
pacparser_init();
pacparser_parse_pac(argv[1]);
proxy = pacparser_find_proxy(argv[2], argv[3]);
printf("%s\n", proxy);
pacparser_cleanup();
}

manugarg@hobbiton:~$ gcc -o pactest pactest.c -lpacparser
manugarg@hobbiton:~$ ./pactest wpad.dat http://www.google.com www.google.com
PROXY proxy1.manugarg.com:3128; PROXY proxy2.manugarg.com:3128; DIRECT

Tags

c http library pac proxy proxyauto-config python web wpad

Quick Reference

MIT
Permitted

Commercial Use

Modify

Distribute

Place Warranty

Use Patent Claims

Forbidden

Sub-License

Hold Liable

Required

Distribute Original

Disclose Source

Include Copyright

State Changes

Include License

Include Install Instructions

These details are provided for information only. No information here is legal advice and should not be used as such.

Project Security

Vulnerabilities per Version ( last 10 releases )

There are no reported vulnerabilities

Project Vulnerability Report

Security Confidence Index

Poor security track-record
Favorable security track-record

Vulnerability Exposure Index

Many reported vulnerabilities
Few reported vulnerabilities

Did You Know...

  • ...
    65% of companies leverage OSS to speed application development in 2016
  • ...
    you can subscribe to e-mail newsletters to receive update from the Open Hub blog
  • ...
    nearly 1 in 3 companies have no process for identifying, tracking, or remediating known open source vulnerabilities
  • ...
    search using multiple tags to find exactly what you need
About Project Security

Languages

C
85%
C++
8%
8 Other
7%

30 Day Summary

Mar 23 2024 — Apr 22 2024

12 Month Summary

Apr 22 2023 — Apr 22 2024
  • 47 Commits
    Up + 41 (683%) from previous 12 months
  • 5 Contributors
    Up + 1 (25%) from previous 12 months