UNPKG

11.4 kBMarkdownView Raw
1# Luminati Proxy manager
2
3[![dependencies Status](https://david-dm.org/luminati-io/luminati-proxy/status.svg)](https://david-dm.org/luminati-io/luminati-proxy)
4[![devDependencies Status](https://david-dm.org/luminati-io/luminati-proxy/dev-status.svg)](https://david-dm.org/luminati-io/luminati-proxy?type=dev)
5[![optionalDependencies Status](https://david-dm.org/luminati-io/luminati-proxy/optional-status.svg)](https://david-dm.org/luminati-io/luminati-proxy?type=optional)
6
7一个HTTP/HTTPS 代理服务器在你身边,为你世界各地的代理流量加速/压缩/轮流/分发/管理/监控/汇报/日志/调试
8
9用 Luminati HTTP/HTTPS 代理管理器你可以使用Luminati 住宅 IPs 或 Luminati 数据心 IPs.
10
11这个工具需要一个 [Luminati](https://lum-lpm.com/?cam=github-proxy) 账户.
12
13## 特征
14- 可扩展
15- 连接池(更快的反应)
16- 省心的建立组态
17- 统计数据
18- 每N请求自动轮流IP
19- 负载均衡
20- SSL 嗅探
21- SOCKSv5 代理
22
23### 软件更新要求
24- 2GB RAM
25- 1 CPU
26- 50GB SSD
27- 2TB 宽带
28- Ubuntu 16 LTS
29
30## 安装
31
32### 要求
33软件要求:
34
35- <a href="https://git-scm.com/downloads/">Git</a> 1.7+版
36- <a href="https://nodejs.org/en/download/">Node.js</a> 6+版
37
38### Windows
39下载 <a href="https://lum-lpm.com/static/lpm/luminati-proxy-manager-v1.164.328-setup.exe">代理管理安装器</a>.
40
41### Linux/MacOS
42- 安装 Node.js 10.15.3版 (最好用x
43 [nave](https://github.com/isaacs/nave))
44- 从终端安装 Luminati 代理:
45```sh
46sudo npm install -g luminati-io/luminati-proxy
47```
48### 升级
49- 用npm升级
50```sh
51sudo npm install -g luminati-io/luminati-proxy
52```
53### 发布说明
54
55你可以在 [CHANGELOG.md](https://github.com/luminati-io/luminati-proxy/blob/master/CHANGELOG.md) 里找到每个版本的修改.
56
57## 运用
58
59### 第一次运行
60第一次运行之后:
61```sh
62luminati
63```
64把你的浏览器设到 [http://127.0.0.1:22999](http://127.0.0.1:22999) 为了设置凭证和代理服务器.
65
66登录之后,你会看到Luminati的默认设置所含一个”drop in”代理服务器在接口22225运行。细节提供在下面.
67
68### 超级代理服务器的‘Dropin’替代
69
70Luminati 代理服务器所含的”Dropin 模式” 和现有的超级代理服务器的功能相同。在 ‘dropin’ 模式运行代理时,你不需要登录行政UI就能发出请求。代理账户和密码会自动被提供。’dropin’ 模式是默认模式,和可以让你容易的从一般的超级代理服务器转到Luminati 代理管理器.
71
72’dropin’ 模式是默认模式。如果你想禁用’dropin’,请用命令:--no-dropin:
73
74```sh
75luminati --no-dropin
76```
77
78为了完整的API解说文件 (为了'dropin'代理请求),请从你的Luminati.io账户关注 <a href="https://lum-lpm.com/cp/api_example?manager=all&group=active">API例网页</a>.
79
80### 完整的API命令名单:
81```sh
82luminati --help
83Usage:
84 luminati [options] config1 config2 ...
85
86Options:
87 --port, -p Port for the HTTP proxy [number]
88 --proxy_type Decide if to save proxy into the configuration file.
89 Specifying "persist" in "proxy_type" value will
90 create port and save it in the configuration file.
91 [string]
92 --multiply Multiply the port definition given number of times
93 [number]
94 --ssl Enable SSL analyzing [boolean] [default: false]
95 --log Log level [string] [default: "notice"]
96 --iface Interface or IP to listen on
97 [string] [default: "0.0.0.0"]
98 --customer Luminati customer [string]
99 --zone Zone [string] [default: "static"]
100 --password Zone password [string]
101 --proxy Hostname or IP of super proxy
102 [string] [default: "zproxy.lum-superproxy.io"]
103 --proxy_port Super proxy port [number] [default: 22225]
104 --proxy_connection_type Connection type between LPM and Super Proxy
105 [string] [default: http]
106 --proxy_retry Automatically retry on super proxy failure
107 [number] [default: 2]
108 --insecure Enable SSL connection/analyzing to insecure hosts
109 [boolean] [default: false]
110 --country Country [string]
111 --state State [string]
112 --city City [string]
113 --asn ASN [number]
114 --ip Data center IP [string]
115 --vip gIP [number]
116 --ext_proxies A list of proxies from external vendors. Format:
117 [username:password@]ip[:port] [array]
118 --ext_proxy_username default username for external vendor ips [string]
119 --ext_proxy_password default password for external vendor ips [string]
120 --ext_proxy_port default port for external vendor ips [number]
121 --dns DNS resolving [string]
122 --reverse_lookup_dns Process reverse lookup via DNS
123 [boolean] [default: false]
124 --reverse_lookup_file Process reverse lookup via file [string]
125 --reverse_lookup_values Process reverse lookup via value [array]
126 --session Luminati session for all proxy requests [string]
127 --pool_size Session pool size [number] [default: 3]
128 --max_requests Maximum requests per session [string] [default: 50]
129 --session_duration Maximum duration of session (seconds) [string]
130 --throttle Throttle requests above given number [number]
131 --whitelist_ips Whitelist ip list for granting access to proxy
132 [array] [default: []]
133 --race_reqs Race several requests at once and choose fastest
134 [number]
135 --www HTTP and WebSocket port used for browser admin UI
136 and request logs [number] [default: 22999]
137 --www_whitelist_ips Whitelist IPs to access browser admin UI. [string]
138 [default:"127.0.0.1"]
139 [example: --www_whitelist_ips "212.17.0.1"]
140 --config Config file containing proxy definitions
141 [string] [default: "~/.luminati.json"]
142 --cookie Cookie Jar file
143 [string] [default: "~/.luminati.jar"]
144 --dropin Create dropin mode proxy port (default: 22225)
145 [boolean] [default: true]
146 --dropin_port Port for dropin mode [default: 22225]
147 --no_usage_stats Disable collection of usage statistics
148 [boolean] [default: false]
149 --token A Google authorization token for accessing
150 luminati.io [string]
151 --request_stats Enable requests statistics [boolean] [default: true]
152 --test_url A url for testing proxy
153 [string] [default: "http://lumtest.com/myip.json"]
154 --no-www Disable local web
155 --no-config Working without a config file
156 --no-cookie Working without a cookie file
157 --daemon, -d Start as a daemon
158 --stop-daemon Stop running daemon
159 --upgrade Upgrade proxy manager
160 --force Force LPM to run and kill other processes if needed
161 [boolean] [default: false]
162 --version, -v Show version number [boolean]
163 --help, -h, -? Show help [boolean]
164 --api [default: "https://lum-lpm.com"]
165 --local_login Requires each browser to authenticate against LPM
166 [boolean] [default: false]
167 --read_only Avoid saving current config in config file [boolean]
168
169```
170
171### Docker
172
173'Docker' 图片能在这里找着 [https://hub.docker.com/r/luminati/luminati-proxy/](https://hub.docker.com/r/luminati/luminati-proxy/)
174
175```sh
176docker pull luminati/luminati-proxy
177
178docker run luminati/luminati-proxy
179
180docker run luminati/luminati-proxy luminati --version
181```
182
183### SSL 请求
184
185-ssl 参数是为了 SSL analyzing, HTTPS请求不需要它就能运行
186
187## 帮助
188
189常见问题 [FAQ](https://lum-lpm.com/faq#proxy)
190
191如果你在Luminati 常见问题找不着解决方式,可以在 [github 上提问](https://github.com/luminati-io/luminati-proxy/issues).
192
193或联系 [support@luminati.io](mailto:support@luminati.io).
194
195## REST API
196
197API的解说文件能在APP里找着
198
199详细解释能在 [这里](http://petstore.swagger.io/?url=https://raw.githubusercontent.com/luminati-io/luminati-proxy/master/lib/swagger.json) 找到
200
201## Node.js API
202
203代理管理器可以当作一个需要的软件为了node.js软件 - 消除独立运行node.js的必要.
204
205API支持 [Promises](https://www.promisejs.org/) 和 [Generators](https://www.promisejs.org/generators/). 它内部会用 [request module](https://github.com/request/request) 莫和支持所有它的特征
206
207### Promises
208```js
209'use strict';
210const Server = require('luminati-proxy').Server;
211
212const proxy = new Server({
213 customer: 'CUSTOMER', // your customer name
214 password: 'PASSWORD', // your password
215 zone: 'gen', // zone to use
216});
217proxy.on('response', res=>console.log('Response:', res));
218proxy.listen(0, '127.0.0.1').then(()=>new Promise((resolve, reject)=>{
219 proxy.request('http://lumtest.com/myip', (err, res)=>{
220 if (err)
221 return reject(err);
222 resolve(res);
223 });
224})).then(res=>{
225 console.log('Result:', res.statusCode, res.body);
226}, err=>{
227 console.log('Error:', err);
228}).then(()=>proxy.stop());
229```
230
231### Generators
232```js
233'use strict';
234const etask = require('./util/etask.js');
235const Server = require('luminati-proxy').Server;
236
237etask(function*(){
238 const proxy = new Server({
239 customer: 'CUSTOMER', // your customer name
240 password: 'PASSWORD', // your password
241 zone: 'gen', // zone to use
242 });
243 yield proxy.listen(0, '127.0.0.1'); // port and ip to listen to
244 let res = yield etask.nfn_apply(proxy, '.request',
245 ['http://lumtest.com/myip']);
246 console.log('Result:', res.statusCode, res.body);
247 yield proxy.stop();
248});
249```