Anon Protocol NPM Package
Install
npm install anon-protocol
Run Anon Client
npx anon-protocol
Run Anon Proxy (Example Usage)
npx anon-proxy curl icanhazip.com
Build
npm run build
Usage Example (Typescript)
import { Anon } from 'anon-protocol';
import { SocksProxyAgent } from 'socks-proxy-agent';
import axios from 'axios';
const socksPort = 9050;
const anon = new Anon({ socksPort });
const proxyOptions = `socks5h://127.0.0.1:${socksPort}`;
const httpAgent = new SocksProxyAgent(proxyOptions);
const httpsAgent = httpAgent;
const client = axios.create({ httpAgent, httpsAgent });
(async () => {
await anon.start();
const resp = await axios.get('https://api.ipify.org?format=json');
const anonResp = await client.get('https://api.ipify.org?format=json');
console.log(`Real IP: ${resp.data.ip}`);
console.log(`Anon IP: ${anonResp.data.ip}`);
await anon.stop();
})();
function shutdown() {
anon.stop();
process.exit(0);
}
process.once('SIGINT', shutdown);
process.once('SIGTERM', shutdown);
Response should look like:
Real IP: 94.16.115.212
Anon IP: 89.58.10.128
Docs
To generate API docs:
npm run typedoc
Docs will be generated to docs/
directory, open index.html
to view it