# luminati-tunnel

> HTTP/HTTPS tunnel proxy for luminati.io using round robin strategy.

Latest version **1.3.0** (published 2019-05-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install luminati-tunnel
pnpm add luminati-tunnel
yarn add luminati-tunnel
bun add luminati-tunnel
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.3.0 |
| Published | 2019-05-11 |
| First published | 2019-05-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 8 |
| Dependencies | 2 |
| Unpacked size | 11.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Kiko Beats |
| Maintainers | kikobeats |
| Keywords | agent, http, https, luminati, proxy, tunnel |

## Links

- npm: https://www.npmjs.com/package/luminati-tunnel
- Repository: https://github.com/Kikobeats/luminati-tunnel
- Homepage: https://nicedoc.io/Kikobeats/luminati-tunnel
- Issues: https://github.com/Kikobeats/luminati-tunnel/issues
- npm.io page: https://npm.io/package/luminati-tunnel

## Dependencies (2)

- [cycled](https://npm.io/package/cycled.md) ~1.1.0
- [tunnel](https://npm.io/package/tunnel.md) 0.0.6

## Recent versions

- 1.3.0 (latest) — 2019-05-11
- 1.2.0 — 2019-05-11
- 1.1.0 — 2019-05-09
- 1.0.0 — 2019-05-08

## README

# luminati-tunnel

![Last version](https://img.shields.io/github/tag/Kikobeats/luminati-tunnel.svg?style=flat-square)
[![Build Status](https://img.shields.io/travis/Kikobeats/luminati-tunnel/master.svg?style=flat-square)](https://travis-ci.org/Kikobeats/luminati-tunnel)
[![Coverage Status](https://img.shields.io/coveralls/Kikobeats/luminati-tunnel.svg?style=flat-square)](https://coveralls.io/github/Kikobeats/luminati-tunnel)
[![Dependency status](https://img.shields.io/david/Kikobeats/luminati-tunnel.svg?style=flat-square)](https://david-dm.org/Kikobeats/luminati-tunnel)
[![Dev Dependencies Status](https://img.shields.io/david/dev/Kikobeats/luminati-tunnel.svg?style=flat-square)](https://david-dm.org/Kikobeats/luminati-tunnel#info=devDependencies)
[![NPM Status](https://img.shields.io/npm/dm/luminati-tunnel.svg?style=flat-square)](https://www.npmjs.org/package/luminati-tunnel)

> HTTP/HTTPS tunnel proxy for luminati.io using round robin strategy.

## Install

```bash
$ npm install luminati-tunnel --save
```

## Usage

The instance is a function that returns a different proxy tunnel every time you call it, using [round robin](https://en.wikipedia.org/wiki/Round-robin_DNS) algorithm.

```js
const luminatiTunnel = require('luminati-tunnel')

const proxies = [ 'proxy1', 'proxy2', 'proxy3' ]
const tunnel = createTunnel(proxies)
const url = 'http://lumtest.com/echo.json'

;(async () => {
  // => it uses 'proxy1'
  await got(url, {
    agent: tunnel(),
    json: true
  })

  // => it uses 'proxy2'
  await got(url, {
    agent: tunnel(),
    json: true
  })

  // => it uses 'proxy3'
  await got(url, {
    agent: tunnel(),
    json: true
  })

  // => it uses 'proxy1'
  await got(url, {
    agent: tunnel(),
    json: true
  })
})()
```

## API

### `tunnel = luminatiTunnel(proxies, [fromIndex])`

#### proxies

*Required*<br>
Type: `array`

A collection of the proxy IPs to use.

You can get it from your [luminati.io](https://luminati.io/) control panel.

![](https://luminati-holanetworksltd.netdna-ssl.com/www/lum/pub/img/ip_list.png?md5=22129-f8b3b8e5)

Read more at [documentation](https://luminati.io/faq#download-ips).

#### fromIndex

Type: `number`<br>
Default: `0`

It specifies the position of the `proxies` collection to start.

### `tunnel`

The instance is a function that returns a different proxy tunnel every time you call it, using [round robin](https://en.wikipedia.org/wiki/Round-robin_DNS) algorithm.

#### .current()

Returns the current proxy tunnel credential.

#### .index()

Returns the current proxy tunnel index from the `proxies` provided.

#### .next()

Returns the next proxy tunnel credential.

#### .previous()

Returns the previous proxy tunnel credential.

#### .size()

Returns the number of proxies in the pool.

## License

**luminati-tunnel** © [Kiko Beats](https://kikobeats.com), released under the [MIT](https://github.com/Kikobeats/luminati-tunnel/blob/master/LICENSE.md) License.<br>
Authored and maintained by Kiko Beats with help from [contributors](https://github.com/Kikobeats/luminati-tunnel/contributors).

> [kikobeats.com](https://kikobeats.com) · GitHub [Kiko Beats](https://github.com/Kikobeats) · Twitter [@Kikobeats](https://twitter.com/Kikobeats)

---
_Source: https://npm.io/package/luminati-tunnel · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
