Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/orisano/oproxypac
https://github.com/orisano/oproxypac
Last synced: 24 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/orisano/oproxypac
- Owner: orisano
- License: mit
- Created: 2017-05-31T13:45:25.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-03-30T12:59:12.000Z (over 3 years ago)
- Last Synced: 2024-10-04T17:51:08.278Z (about 1 month ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# oproxypac
Androidなどの細かいproxyの設定が可能でない環境向けの自動プロキシ設定ファイル配信用サーバを作るためのライブラリです.## Install
```bash
npm install oproxypac
```## Example
'http://localhost:8081/proxy.pac' でhttp通信のみlocal ipの8080で起動しているプロキシに転送する例
```js
const os = require("os");
const ProxyPacServer = require("oproxypac");const IP = os.networkInterfaces().en0.find(x => x.family === "IPv4").address;
const PROXY_PORT = 8080;
const PORT = 8081;
const proxyPacServer = new ProxyPacServer(`${IP}:${PROXY_PORT}`);proxyPacServer
.protocol("http")
.listen(PORT)
.then(() => {
console.info(`listen localhost:${PORT}`);
});
```