{"id":18749031,"url":"https://github.com/timeforaninja/pacserver","last_synced_at":"2025-11-25T22:30:16.345Z","repository":{"id":240850280,"uuid":"803496954","full_name":"TimeForANinja/pacserver","owner":"TimeForANinja","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-21T05:36:41.000Z","size":29,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-05-22T04:50:59.626Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TimeForANinja.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-20T20:47:58.000Z","updated_at":"2024-06-19T06:42:55.553Z","dependencies_parsed_at":"2024-05-21T04:50:46.272Z","dependency_job_id":"d6e5c4e2-8168-462f-b7cd-e34caf5a163d","html_url":"https://github.com/TimeForANinja/pacserver","commit_stats":null,"previous_names":["timeforaninja/pacserver"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimeForANinja%2Fpacserver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimeForANinja%2Fpacserver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimeForANinja%2Fpacserver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimeForANinja%2Fpacserver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TimeForANinja","download_url":"https://codeload.github.com/TimeForANinja/pacserver/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239635518,"owners_count":19672190,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T17:05:51.857Z","updated_at":"2025-11-25T22:30:16.271Z","avatar_url":"https://github.com/TimeForANinja.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PAC-Server\nThis is a custom server made to serve Proxy Auto Config (short PAC) Files based on Source IP.\n\n## Setup\nThe setup of this App is pretty straight forward.\nAfter downloading the executable you only require the following three parameters:\n\n### Config\nThe application expects a `./config.yml` in the cwd.\nThe supported fields for that yaml are:\n\n| Field         | Type   | Description                                                     |\n|---------------|--------|-----------------------------------------------------------------|\n| ipMapFile     | string | path to the Zones `.csv` file                                   |\n| pacRoot       | string | path to the directory containing the PAC Files                  |\n| contactInfo   | string | Contact Info that can be used inside the PAC Templates          |\n| accessLogFile | string | the path to the access log file                                 |\n| eventLogFile  | string | the path to the event log file                                  |\n| doAutoRefresh | bool   | Yes to Automatically reload PAC and Zones in a regular interval |\n| maxCacheAge   | int    | The interval (in seconds) to reload the PAC and Zone files in   |\n\n### Zones\nZones map IP Networks to PAC Files\nThe program expects a CSV, each row is one rule and it supports the following columns\n\n| Column ID | type | Description                                                                                                                                      |\n|-----------|------|--------------------------------------------------------------------------------------------------------------------------------------------------|\n| 0         | ip   | The Network Address of this rule                                                                                                                 |\n| 1         | int  | The (CIDR) Network Size                                                                                                                          |\n| 2         | file | The path to the PAC file to use, relative to `pacRoot`                                                                                           |\n| 3-        | host | Variables to use for Proxies. If you provide more than one column it will use them as alternative Proxies and do Source IP Based load balancing. |\n\n### PACs\nLastly you need to provide the PAC Files themselves.\nThe application allows for the Use of some Template variables.\nThe known variables are:\n\n| Variable | Description                                          |\n|----------|------------------------------------------------------|\n| Filename | The (relative) Filename of th file being server      |\n| Proxy    | (One of) the Proxies provided in the `zones.csv`     |\n| Contact  | Generic Contact Information provided in `config.yml` |\n\nTo use them, you can use the following Syntax `{{ .\u003cvar name\u003e }}`\n\nBelow you can find an example:\n\n```js\n// Welcome\n// This is the {{ .Filename }} PACfile\n// For Changes please reach out to {{ .Contact }}\n\nvar proxy = \"{{ .Proxy }}\"\n\nfunction FindProxyForURL(url, host) {\n    if (host === \"localhost\"\n        || isInNet(host, \"127.0.0.0\", \"255.0.0.0\")\n    ) {\n        return \"DIRECT\"\n    }\n\n    return \"PROXY \" + proxy\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimeforaninja%2Fpacserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimeforaninja%2Fpacserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimeforaninja%2Fpacserver/lists"}