New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

proxy-manager-api

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

proxy-manager-api

Proxy-Manger-API is an API wrapper for https://nginxproxymanager.com/

latest
Source
npmnpm
Version
1.0.5
Version published
Maintainers
1
Created
Source

Proxy-Manager-API


GitHub issues GitHub forks GitHub stars

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: 'admin@example.com',
    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: 'admin@example.com',
    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: 'admin@example.com',
    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);
    });
});
  • GitHub
  • NPM

Docs Coming Soon.

License

This project is licensed under the MIT license. See the LICENSE file for details.

FAQs

Package last updated on 09 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts