{"id":15694068,"url":"https://github.com/hbollon/proxy-login-automator","last_synced_at":"2025-05-08T06:00:09.447Z","repository":{"id":112273405,"uuid":"351206952","full_name":"hbollon/proxy-login-automator","owner":"hbollon","description":"🚀 Node.js application to automatically inject user/password to http proxy server via a local forwarder. Also support PAC servers.","archived":false,"fork":false,"pushed_at":"2021-11-21T15:06:58.000Z","size":16,"stargazers_count":7,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-08T06:00:03.100Z","etag":null,"topics":["authenticator","forward-proxy","forwarder","node","nodejs","pac-server","proxy","proxy-auth","proxy-server"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/hbollon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["hbollon"],"ko_fi":"hugobollon","custom":["paypal.me/hugobollon"]}},"created_at":"2021-03-24T19:58:19.000Z","updated_at":"2024-01-12T12:40:42.000Z","dependencies_parsed_at":"2023-05-31T22:01:22.218Z","dependency_job_id":null,"html_url":"https://github.com/hbollon/proxy-login-automator","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hbollon%2Fproxy-login-automator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hbollon%2Fproxy-login-automator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hbollon%2Fproxy-login-automator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hbollon%2Fproxy-login-automator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hbollon","download_url":"https://codeload.github.com/hbollon/proxy-login-automator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253009892,"owners_count":21839714,"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":["authenticator","forward-proxy","forwarder","node","nodejs","pac-server","proxy","proxy-auth","proxy-server"],"created_at":"2024-10-03T18:51:53.053Z","updated_at":"2025-05-08T06:00:09.422Z","avatar_url":"https://github.com/hbollon.png","language":"JavaScript","funding_links":["https://github.com/sponsors/hbollon","https://ko-fi.com/hugobollon","paypal.me/hugobollon"],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eproxy-login-automator\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e🚀 Node.js application to automatically inject user/password to http proxy server via a local forwarder. Also support PAC servers.\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\u003cstrong\u003e This project was originally created by @sjitech but unfortunately it was abandoned. This repository fixes compatibility issues with recent versions of node, offers an executable and will remain updated.\u003cbr\u003e\nThanks to them for this wonderful tool! \u003c/strong\u003e\u003c/p\u003e\n\n## Table of Contents\n\n- [Presentation](#presentation)\n- [Usage](#usage)\n  - [Normal Proxy Server](#normal-proxy-server)\n  - [PAC Server](#pac(proxy-auto-configuration)-server)\n- [Notes](#notes)\n- [Contributing](#-contributing)\n- [Author](#author)\n- [License](#-license)\n\n## Presentation\n\nThis project is a single node.js script to automatically inject user/password to http proxy server via a local forwarder\n\n- This is done by creating a local proxy server which forward requests to real proxy server with password injected.\nYou change your browser's proxy config to use the local proxy server so that you can browse internet \nwithout being asked for user/password.\n\n- Can act as a [PAC(proxy auto configuration)](https://en.wikipedia.org/wiki/Proxy_auto-config) server if real proxy provides PAC. \nIn this case, each real proxy server defined in PAC will be dynamically replaced with a local proxy server\nwhich forward requests to real proxy with password injected.\n\n## Usage\n\n- Please install node.js first.\n \n- Install \u0026 Run\n\n  - Normal way: Download \u0026 cd this project dir then run the js from node.\n  ```\n  git clone https://github.com/sjitech/proxy-login-automator\n  node proxy-login-automator/proxy-login-automator.js\n  ```\n\n  - NPM way: You can also install it by npm then run it directly\n  ```\n  npm install -g proxy-login-automator\n  proxy-login-automator\n  ```\n\n  - Geek way: If you do not want to save anything to your disk then you can run this command in `bash`\n  ```\n  node \u003c(curl -sSL https://raw.githubusercontent.com/sjitech/proxy-login-automator/master/proxy-login-automator.js)\n  ```\n\n- Parameters of `proxy-login-automator.js`:\n\n    ```\n    -local_host host        Listening address. Default: localhost. (* means all interfaces)\n    -local_port port        Listening port. Default: 8080\n    -remote_host host       Real proxy/PAC server address\n    -remote_port port       Real proxy/PAC server port. Default: 8080\n    -usr user               Real proxy/PAC server user id\n    -pwd password           Real proxy/PAC user password\n    -as_pac_server true/false       Treat real proxy/PAC server as a PAC server. Default: false\n    \n    -is_remote_https true/false     Talk to real proxy/PAC server with HTTPS. Default: false\n    -ignore_https_cert true/false   ignore error when verify certificate of real proxy/PAC server. Default: false\n    -are_remotes_in_pac_https true/false    Talk to proxy servers defined in PAC with HTTPS. Default: false\n    ```\n\n### Normal Proxy Server\n\n- You have a proxy server `http://REAL_PROXY_IP:8080`\n\n    This server requires a user/password.\n\n- You run following command to create a local trampoline at `localhost:8081`\n\n    Mac/Linux:\n    ```\n    node proxy-login-automator.js \\\n        -local_port 8081 \\\n        -remote_host REAL_PROXY_IP \\\n        -remote_port 8080 \\\n        -usr USER -pwd PASSWORD\n    ```\n    Windows:\n    ```\n    node proxy-login-automator.js ^\n        -local_port 8081 ^\n        -remote_host REAL_PROXY_IP ^\n        -remote_port 8080 ^\n        -usr USER -pwd PASSWORD\n    ```\n\n- Then you can set your browser's proxy = `localhost:8081`\n\n    As a quick test, you can start a new process of chrome with the local proxy:\n\n    MacOS/Linux: (for Linux, just change the path of Chrome please):\n    ```\n    \"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome\" \\\n        --user-data-dir=$HOME/chrome_data/ \\\n        --proxy-server=http://localhost:8081 \\\n        \u003e/dev/null 2\u003e\u00261 \u0026\n    ```\n    Windows:\n    ```\n    \"C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe\" ^\n        --user-data-dir=%APPDATA%\\chrome_data ^\n        --proxy-server=http://localhost:8081\n    ```\n\n### [PAC(proxy auto configuration)](https://en.wikipedia.org/wiki/Proxy_auto-config) Server\n\n- You have a pac server serving at `http://REAL_PAC_SERVER_IP:8080/PAC_PATH/PAC_NAME`\n\n    This server may require a user/password or not, it does not matter.\n\n    The PAC_PATH/PAC_NAME points to a [PAC file](https://en.wikipedia.org/wiki/Proxy_auto-config)\n    which contains instructions says\n    ```\n    function FindProxyForURL(url, host) {\n        if (shExpMatch(url,\"*.google.com*\")) return \"PROXY proxy1:port1\"\n        if (shExpMatch(url,\"*.microsoft.com*\")) return \"PROXY proxy2:port2\"\n        ...\n        return \"DIRECT\"\n    }\n    ```\n    means use child proxy servers\n    ```\n    proxy1:port1\n    proxy2:port2\n    ...\n    ```\n\n    **Assume all user/password are same**.\n\n    If you want use your own local PAC file, you need set up a local http server to serve the PAC file.\n    See [use a local pac](https://github.com/sjitech/proxy-login-automator/issues/14#issuecomment-379951268).\n\n- You run following command to create a trampoline at `http://localhost:65000/PAC_PATH/PAC_NAME`\n\n    Mac/Linux:\n    ```\n\tnode proxy-login-automator.js \\\n\t    -local_port 65000 \\\n\t    -remote_host REAL_PAC_SERVER_IP \\\n\t    -remote_port 8080 \\\n\t    -usr USER -pwd PASSWORD \\\n\t    -as_pac_server true\n\t```\n    Windows:\n    ```\n\tnode proxy-login-automator.js ^\n\t    -local_port 65000 ^\n\t    -remote_host REAL_PAC_SERVER_IP ^\n\t    -remote_port 8080 ^\n\t    -usr USER -pwd PASSWORD ^\n\t    -as_pac_server true\n\t```\n\n    - This tool dynamically creates multiple child proxy servers which auto inject user/password when talking to real proxy servers.\n\n    - The child proxy servers will listen at\n    ```\n    localhost:65001 for proxy1:port1\n    localhost:65002 for proxy2:port2\n    ...\n    ```\n\n    **Please specify a big port number as PAC server port because this tool allocate ports INCREMENTALLY like**\n    ```\n    65000 + 1 for first detected proxy server from PAC\n    65000 + 2 for second detected proxy server from PAC\n    ....\n    65000 + Count Of Real Proxy Servers\n    ```\n\n    If you specify a small port number as PAC server port, then the port allocation may fail due to other process may have been using that port.\n\n- Then you can set your browser's PAC url = `http://localhost:65000/PAC_PATH/PAC_NAME`\n\n    As a quick test, you can start a new process of chrome with the local PAC server:\n\n    MacOS/Linux: (for Linux, just change the path of Chrome please):\n    ```\n    “/Applications/Google Chrome.app/Contents/MacOS/Google Chrome” \\\n       --user-data-dir=$HOME/chrome_data/ \\\n       --proxy-pac-url=http://localhost:65000/PAC_PATH/PAC_NAME \\\n       \u003e/dev/null 2\u003e\u00261 \u0026\n    ```\n    Windows:\n    ```\n    \"C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe\" \\\n      --user-data-dir=%APPDATA%\\chrome_data \\\n      --proxy-pac-url=http://localhost:65000/PAC_PATH/PAC_NAME\n    ```\n\n\n## Notes\n\n### Note for \"Windows Store Apps\"\n\nThe Windows Store Apps (such as pre-installed Weather, Calender) maybe use \"Isolated Network\" settings which does not respect Internet Option of IE or control panel.\n\nWindows Store Apps may have its own network policy such as how to connect to internet.\nThere are group policy Computer Configuration\\Policies\\Administrative Templates\\Network\\Network Isolation\\Internet proxy servers for apps to serve these apps.\n\nTo change proxy of \"Windows Store Apps\"\nSee [setup-proxy-metro-application-windows-8](http://www.thewindowsclub.com/setup-proxy-metro-application-windows-8)\n\n### Note for other authentication(such as NTLM)\n\nThis tool currently only support HTTP basic authentication to real proxy/PAC server.\n\nIf you want to use other authentication such as NTLM,\nyou can use other tool such as [NGINX reverse proxy to NTLM authenticated http server](http://nginx.org/en/docs/http/ngx_http_upstream_module.html#ntlm).\n\n2018/04/10: plan to support NTLM and other normal authentication.\n\n### Note for HTTPS\n\nProxy Server normally supports HTTPS browsing by [handling HTTP tunnel request](https://en.wikipedia.org/wiki/HTTP_tunnel),\nso this tool also support HTTPS browsing of course if the real proxy server does.\n\nHowever, due to historical reason, **most browsers always use HTTP to talk to proxy server\neven when browsing HTTPS sites**(done by HTTP tunnel described in above link).\n\nCurrently only Chrome support HTTPS talking.\n\nSo this tool only use HTTP to talk to real proxy server. **You can use NGINX to redirect HTTP to other HTTPS server**.\n\n### 2017/01/30: now support talk to real proxy/PAC server with HTTPS by specify following parameters:\n\n```\n-is_remote_https true\n```\nin addition, to ignore error when verify HTTPS server certificate, you can specify\n```\n-ignore_https_cert true\n```\nFor proxy servers defined in PAC, if they also need be talked with HTTPS, then specify\n```\n-are_remotes_in_pac_https true\n```\n\nNote: anyway, the local proxy/PAC server is always served as a HTTP server.\n\n### Note for WebSocket\n\nThis tool support WebSocket if the real proxy server supports.\n\nGood luck\n\n## 🤝 Contributing\n\nContributions are greatly appreciated!\n\n1. Fork the project\n2. Create your feature branch (```git checkout -b feature/AmazingFeature```)\n3. Commit your changes (```git commit -m 'Add some amazing stuff'```)\n4. Push to the branch (```git push origin feature/AmazingFeature```)\n5. Create a new Pull Request\n\nIssues and feature requests are welcome!\nFeel free to check [issues page](https://github.com/hbollon/igopher/issues).\n\n## Author\n\n👤 **Hugo Bollon**\n\n* Github: [@hbollon](https://github.com/hbollon)\n* LinkedIn: [@Hugo Bollon](https://www.linkedin.com/in/hugobollon/)\n* Portfolio: [hugobollon.me](https://www.hugobollon.me)\n\nThanks to @sjitech the original authors of this project !\n\n## Show your support\n\nGive a ⭐️ if this project helped you!\n\n## 📝 License\n\nThis project is under [MIT](https://github.com/hbollon/proxy-login-automator/blob/master/LICENSE.md) license.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhbollon%2Fproxy-login-automator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhbollon%2Fproxy-login-automator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhbollon%2Fproxy-login-automator/lists"}