Skip to content

renzbobz/proxysub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

proxysub

Proxy service provider url builder

Installation

npm i proxysub

Usage

import Proxysub from "proxysub";

const proxy = new Proxysub(options);

Options object:

name type description
provider string Proxy provider name
config object Proxy provider connection settings
params object Proxy provider connection params
session boolean if true, this will auto-generate session param

Currently supported proxy providers:

  • mango_proxy
  • packet_stream
  • bright_data
  • lightning_proxies

Methods

// Get session id that was used
getSessionId(): string;
// Get proxy provider name
getName(): string;
// Get created proxy url
getUrl(): string;
getUsername(): string;
getHost(): string;
getProtocol(): string;
getPort(): number;

Example usage

import { HttpsProxyAgent } from "https-proxy-agent";
import Proxysub from "proxysub";

const proxy = new Proxysub({
  provider: "lightning_proxies",
  config: {
    host: "host",
    port: 69,
    username: "username",
    password: "password",
  },
  params: {
    region: "ph",
  },
});

const proxyUrl = proxy.getUrl();
const proxyAgent = new HttpsProxyAgent(proxyUrl);
// then fetch target url with proxyAgent present

Check tests

About

Proxy service url builder

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published