proxy-manager-api
v1.0.5
Published
Proxy-Manger-API is an API wrapper for https://nginxproxymanager.com/
Downloads
4
Readme
Info
Proxy-Manager-API is a simple API for managing Nginx Proxies Using https://nginxproxymanager.com.
Installation
npm install proxy-manager-api
yarn add proxy-manager-api
Usage
Login and Get all proxies. Then get the info of a certain domain proxied
const ProxyManager = require('proxy-manager-api');
const client = new ProxyManager.Client({
host: 'proxy.example.com',
email: '[email protected]',
password: 'admin'
});
client.connect().then(() => {
client.getProxies().then(proxies => {
console.log(proxies);
});
client.getProxy('proxied.example.com').then(proxy => {
console.log(proxy.ip);
});
});
If you want to proxy a new domain you can do it like this:
const ProxyManager = require('proxy-manager-api');
const client = new ProxyManager.Client({
host: 'proxy.example.com',
email: '[email protected]',
password: 'admin'
});
client.connect().then(() => {
client.proxy.createProxy({
domain: 'proxied.example.com',
ip: '0.0.0.0',
port: 8080,
ssl: true,
}).then(proxy => {
console.log(proxy);
})
});
If you want to proxy multiple domains to one ip and port you can do it like this:
const ProxyManager = require('proxy-manager-api');
const client = new ProxyManager.Client({
host: 'proxy.example.com',
email: '[email protected]',
password: 'admin'
});
client.connect().then(() => {
client.proxy.createProxy({
domain: ['proxied.example.com', 'proxied2.example.com'],
ip: '0.0.0.0',
port: 8080,
ssl: true,
}).then(proxy => {
console.log(proxy);
});
});
Links
Docs Coming Soon.
License
This project is licensed under the MIT license. See the LICENSE file for details.