Coder Social home page Coder Social logo

zen-li / luminati-proxy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from luminati-io/luminati-proxy

0.0 1.0 0.0 21.91 MB

Luminati HTTP/HTTPS Proxy manager

Home Page: https://luminati.io/

JavaScript 98.34% Shell 0.13% HTML 0.74% NSIS 0.02% CSS 0.77%

luminati-proxy's Introduction

Luminati Proxy manager

Build Status Win Status dependencies Status devDependencies Status optionalDependencies Status

A forward HTTP/HTTPS proxy on your side, to accelerate/compress/rotate/distribute/manage/monitor/report/log/debug traffic to your proxies around the world.

With Luminati HTTP/HTTPS Proxy manager you can drive the Luminati residential IPs or Luminati static IPs.

This tool requires a Luminati account.

Read this in δΈ­ζ–‡.

Features

  • Highly scalable
  • Connection pool for faster response time
  • Easy setup for multiple configurations using a simple web interface
  • Statistics
  • Automatically rotate IP every X requests
  • Load balancing using multiple Super Proxies
  • SSL analyzing (using a self-signed certificate)
  • SOCKSv5 proxy

Installation

Windows

Download the Luminati Proxy Manager installer

Linux/MacOs - Install script

  • Run the setup script to install
wget -qO- https://luminati.io/static/lpm/luminati-proxy-latest-setup.sh | bash

Or

curl -L https://luminati.io/static/lpm/luminati-proxy-latest-setup.sh | bash

Linux/MacOS - Manual install

  • Install Node.js 6 or above (nodejs.org)
  • Make sure npm version is 4.6.1 or higher
  • Install Luminati Proxy from the terminal prompt:
sudo npm install -g @luminati-io/luminati-proxy

If the command is returning an error try installing using --unsafe-perm flag

sudo npm install -g @luminati-io/luminati-proxy --unsafe-perm

Upgrade

  • Use npm to upgrade
sudo npm install -g @luminati-io/luminati-proxy

Specific Version

  • To install a specific proxy manager version, choose a version from releases

  • Run (VERSION_NUMBER is the version you've chosen (example: 1.75.355)):

sudo npm install -g @luminati-io/luminati-proxy@VERSION_NUMBER

Release Notes

You can review the CHANGELOG.md for list of changes in every version

Usage

First run

After running the app for the first time:

luminati

Point your browser to the app admin UI http://127.0.0.1:22999 to set up credentials and configure your proxies.

After logging in, you will see that the default configuration for the Luminati proxy includes a "dropin" proxy running on port 22225. This mode is explained in detail below.

Dropin replacement for existing super-proxies

Luminati Proxy comes with a "dropin mode" which behaves exactly like the existing super-proxies. When running a proxy in dropin mode, you do not need to log in via the administrative UI in order to make requests through your proxies. Rather, the proxy username and password are provided with each request to the proxy server. This mode is enabled by default, and you can use this mode as an easy replacement when migrating from the regular super-proxy to the Luminati Proxy Manager.

Dropin mode is enabled by default. To disable the dropin proxy, use the flag --no-dropin:

luminati --no-dropin

For full documentation on the API for making requests through the dropin proxy, see the API Example page in your Luminati.io account.

Complete list of command line options

luminati --help
Usage:
  luminati [options] config1 config2 ...

Options:
  --port, -p              Port for the HTTP proxy      [number] [default: 24000]
  --multiply              Multiply the port definition given number of times
                                                                        [number]
  --history               Log request history                          [boolean]
  --ssl                   Enable SSL analyzing        [boolean] [default: false]
  --socks                 SOCKS5 port                                   [number]
  --log                   Log level                  [string] [default: "error"]
  --iface                 Interface or IP to listen on
                                                   [string] [default: "0.0.0.0"]
  --customer              Luminati customer                             [string]
  --zone                  Zone                         [string] [default: "gen"]
  --password              Zone password                                 [string]
  --proxy                 Hostname or IP of super proxy
                                        [string] [default: "zproxy.luminati.io"]
  --proxy_port            Super proxy port             [number] [default: 22225]
  --proxy_count           Minimum number of super proxies to use
                                                           [number] [default: 1]
  --secure_proxy          Use SSL when accessing super proxy
                                                      [boolean] [default: false]
  --short_username        Use Shorthand username for super proxy credentials
                                                      [boolean] [default: false]
  --proxy_switch          Automatically switch super proxy on failure
                                                           [number] [default: 5]
  --insecure              Enable SSL connection/analyzing to insecure hosts
                                                      [boolean] [default: false]
  --country               Country                                       [string]
  --state                 State                                         [string]
  --city                  City                                          [string]
  --asn                   ASN                                           [number]
  --ip                    Datacenter IP                                 [string]
  --dns                   DNS resolving                                 [string]
  --debug                 Luminati request debug info                   [string]
  --request_timeout       Timeout for request on the super proxy (seconds)
                                                                        [number]
  --allow_proxy_auth      Allow Luminati authentication per request
                                                      [boolean] [default: false]
  --session               Luminati session for all proxy requests       [string]
  --sticky_ip             Use session per requesting host to maintain IP per
                          host                        [boolean] [default: false]
  --pool_size             Session pool size                [number] [default: 3]
  --pool_type             Pool session iteration order
                                                [string] [default: "sequential"]
  --session_init_timeout  Session establish timeout (seconds)
                                                           [number] [default: 5]
  --keep_alive            Generate request to keep session alive after given
                          idle time (seconds)                           [number]
  --seed                  Session ID seed used for identifying sessions from
                          this proxy                                    [string]
  --max_requests          Maximum requests per session    [string] [default: 50]
  --session_duration      Maximum duration of session (seconds)         [string]
  --throttle              Throttle requests above given number          [number]
  --null_response         URL pattern for null response                 [string]
  --bypass_proxy          URL regex for bypassing the proxy manager and
			  send directly to host                         [string]
  --direct_include        URL regex for requests to be sent directly
			  from super proxy      			[string]
  --exclude_include       URL regex for requests to not be sent
			  directly from super proxy 		        [string]
  --www                   UI/API port                           [default: 22999]
  --config                Config file containing proxy definitions
                                          [string] [default: "~/.luminati.json"]
  --database              Database file containing history and cached values
                                       [string] [default: "~/.luminati.sqlite3"]
  --database_history      Database URI to save history instead of default DB
  --resolve               Reverse DNS lookup file                       [string]
  --mode                  Defines a set of permissible operations within the
                          UI/API                      [string] [default: "root"]
  --dropin                Create dropin mode proxy on port 22225
                                                      [boolean] [default: false]
  --no-www                Disable local web
  --no-config             Working without a config file
  --daemon, -d            Start as a daemon
  --stop-daemon           Stop running daemon
  --no_usage_stats        Disable collection of anonymous usage statistics
                                                      [boolean] [default: false]
  --version, -v           Show version number                          [boolean]
  --help, -h, -?          Show help                                    [boolean]

Docker

A docker image can be found on https://hub.docker.com/r/luminati/luminati-proxy/

docker pull luminati/luminati-proxy

docker run luminati/luminati-proxy

docker run luminati/luminati-proxy luminati --version

Make sure to forward appropriate ports. Proxy manager uses by default 22999 for the web console and the api, 22555 for dropin and 24000 for first configurable proxy.

Docker with predefined config file

To use lpm's config file, docker volumes can be used: https://docs.docker.com/storage/volumes/

Following this instructions will make your docker runs with specific config file:

  • create volume
docker volume create lpm-vol
  • Inspect the recently creaed volume
docker inspect lpm-vol

Should output something like this:

  [
    {
        "CreatedAt": "2018-02-01T12:59:58+02:00",
        "Driver": "local",
        "Labels": null,
        "Mountpoint": "/var/lib/docker/volumes/lpm-vol/_data",
        "Name": "lpm-vol",
        "Options": {},
        "Scope": "local"
    }
  ]
  • Take the mountpoint path /var/lib/docker/volumes/lpmvol/_data and run
cd /var/lib/docker/volumes/lpmvol/_data
  • put .luminati.json to this directory (here also will be the logs and other files generated by the container)
  • run docker image and attach this volume:
  docker run --rm --name 'lpm1' --mount source=lpmvol,target=/root
"luminati/luminati-proxy" luminati

SSL Requests

The --ssl parameter is for SSL analyzing, HTTPS requests can be made without it.

Help

The FAQ can be found on the luminati FAQ

If you do not find the answer there, feel free to open an issue on github.

Or contact [email protected].

REST API

Working documentation of the API can be found inside the app.

A non-working version of it can be found here

Node.js API

The proxy manager can be used as a required module for node.js applications - eliminating the need to run it as a standalone process.

The API supports both Promises and Generators. Internally, it uses the request module and supports all of its features.

Promises

'use strict';
const Luminati = require('luminati-proxy').Luminati;

const proxy = new Luminati({
    customer: 'CUSTOMER', // your customer name
    password: 'PASSWORD', // your password
    zone: 'gen', // zone to use
    proxy_count: 5, //minimum number of proxies to use for distributing requests
});
proxy.on('response', res=>console.log('Response:', res));
proxy.listen(0, '127.0.0.1').then(()=>new Promise((resolve, reject)=>{
    proxy.request('http://lumtest.com/myip', (err, res)=>{
        if (err)
            return reject(err);
        resolve(res);
    });
})).then(res=>{
    console.log('Result:', res.statusCode, res.body);
}, err=>{
    console.log('Error:', err);
}).then(()=>proxy.stop());

Generators

'use strict';
const etask = require('hutil').etask;
const Luminati = require('luminati-proxy').Luminati;

etask(function*(){
    const proxy = new Luminati({
        customer: 'CUSTOMER', // your customer name
        password: 'PASSWORD', // your password
        zone: 'gen', // zone to use
        proxy_count: 5, //minimum number of proxies to use for distributing requests
    });
    yield proxy.listen(0, '127.0.0.1'); // port and ip to listen to
    let res = yield etask.nfn_apply(proxy, '.request',
        ['http://lumtest.com/myip']);
    console.log('Result:', res.statusCode, res.body);
    yield proxy.stop();
});

luminati-proxy's People

Contributors

giladno avatar lee-elenbaas avatar ishay-hola avatar assafza avatar ranle avatar fadiaidi avatar ovidiud avatar asafhola avatar orhann21 avatar yaronkhola avatar fudali avatar danielshola avatar micheal91 avatar alberta2016 avatar ofirmalka avatar tamirhola avatar fadiz1012 avatar butros611 avatar orenya-hola avatar galelal avatar michaels1hola avatar shaysem avatar bent123 avatar guyhola avatar mohammadwari avatar noamrom avatar philippevk avatar kotsss avatar john-epc avatar nivhola avatar

Watchers

Zen Li avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.