w-ipproxy 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/.editorconfig +9 -0
  2. package/.eslintignore +3 -0
  3. package/.eslintrc.js +55 -0
  4. package/.github/workflows/ci-test.yml +24 -0
  5. package/.jsdoc +25 -0
  6. package/LICENSE +21 -0
  7. package/README.md +71 -0
  8. package/SECURITY.md +5 -0
  9. package/babel.config.js +15 -0
  10. package/dist/w-ip-proxy.umd.js +7 -0
  11. package/dist/w-ip-proxy.umd.js.map +1 -0
  12. package/docs/WIpProxy.html +642 -0
  13. package/docs/WIpProxy.mjs.html +394 -0
  14. package/docs/fonts/Montserrat/Montserrat-Bold.eot +0 -0
  15. package/docs/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
  16. package/docs/fonts/Montserrat/Montserrat-Bold.woff +0 -0
  17. package/docs/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
  18. package/docs/fonts/Montserrat/Montserrat-Regular.eot +0 -0
  19. package/docs/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
  20. package/docs/fonts/Montserrat/Montserrat-Regular.woff +0 -0
  21. package/docs/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
  22. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
  23. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +978 -0
  24. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
  25. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
  26. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
  27. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
  28. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +1049 -0
  29. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
  30. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
  31. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
  32. package/docs/index.html +84 -0
  33. package/docs/scripts/collapse.js +39 -0
  34. package/docs/scripts/commonNav.js +28 -0
  35. package/docs/scripts/linenumber.js +25 -0
  36. package/docs/scripts/nav.js +12 -0
  37. package/docs/scripts/polyfill.js +4 -0
  38. package/docs/scripts/prettify/Apache-License-2.0.txt +202 -0
  39. package/docs/scripts/prettify/lang-css.js +2 -0
  40. package/docs/scripts/prettify/prettify.js +28 -0
  41. package/docs/scripts/search.js +99 -0
  42. package/docs/styles/jsdoc.css +776 -0
  43. package/docs/styles/prettify.css +80 -0
  44. package/g-get.mjs +23 -0
  45. package/g-srv.mjs +28 -0
  46. package/package.json +33 -0
  47. package/script.txt +18 -0
  48. package/src/WIpProxy.mjs +322 -0
  49. package/src/provideServer.mjs +65 -0
  50. package/test/all.test.mjs +10 -0
  51. package/toolg/addVersion.mjs +4 -0
  52. package/toolg/cleanFolder.mjs +4 -0
  53. package/toolg/gDistRollup.mjs +29 -0
  54. package/toolg/modifyReadme.mjs +4 -0
@@ -0,0 +1,642 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+
5
+ <meta charset="utf-8">
6
+ <title>WIpProxy - Documentation</title>
7
+
8
+
9
+ <script src="scripts/prettify/prettify.js"></script>
10
+ <script src="scripts/prettify/lang-css.js"></script>
11
+ <!--[if lt IE 9]>
12
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
13
+ <![endif]-->
14
+ <link type="text/css" rel="stylesheet" href="styles/prettify.css">
15
+ <link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
16
+ <script src="scripts/nav.js" defer></script>
17
+
18
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
19
+ </head>
20
+ <body>
21
+
22
+ <input type="checkbox" id="nav-trigger" class="nav-trigger" />
23
+ <label for="nav-trigger" class="navicon-button x">
24
+ <div class="navicon"></div>
25
+ </label>
26
+
27
+ <label for="nav-trigger" class="overlay"></label>
28
+
29
+ <nav >
30
+
31
+
32
+ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="WIpProxy.html">WIpProxy</a></li></ul>
33
+
34
+ </nav>
35
+
36
+ <div id="main">
37
+
38
+ <h1 class="page-title">WIpProxy</h1>
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+ <section>
47
+
48
+ <header>
49
+
50
+ <h2>
51
+
52
+ WIpProxy
53
+
54
+ </h2>
55
+
56
+
57
+ </header>
58
+
59
+ <article>
60
+
61
+ <div class="container-overview">
62
+
63
+
64
+
65
+
66
+
67
+ <h4 class="name" id="WIpProxy"><span class="type-signature"></span>new WIpProxy<span class="signature">(opt<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Object}</span></h4>
68
+
69
+
70
+
71
+
72
+
73
+
74
+ <dl class="details">
75
+
76
+ <dt class="tag-description">Description:</dt>
77
+ <dd class="tag-description"><ul class="dummy"><li><p>抓取代理伺服器</p></li></ul></dd>
78
+
79
+
80
+
81
+ <dt class="tag-source">Source:</dt>
82
+ <dd class="tag-source"><ul class="dummy"><li>
83
+ <a href="WIpProxy.mjs.html">WIpProxy.mjs</a>, <a href="WIpProxy.mjs.html#line62">line 62</a>
84
+ </li></ul></dd>
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+
111
+
112
+
113
+
114
+
115
+
116
+ </dl>
117
+
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+ <h5 class="h5-examples">Example</h5>
129
+
130
+ <pre class="prettyprint"><code>import _ from 'lodash-es'
131
  // tar: `https://api.binance.com/api/v3/ticker/price?symbol=BTCUSDT`,
1
132
  withServer: true,
2
133
  serverPort: 9000,
3
134
  serverCorsOrigins: ['*'],
4
135
  console.log(`已抓取公開代理共 ${_.size(prxsRaw)} 個...`)
5
136
  // console.log('新加入代理', { host: p.host, port: p.port }, _.map(proxies, 'proxy'))
6
137
  // console.log('刪除代理', { host: p.host, port: p.port }, _.map(proxies, 'proxy'))
7
138
  // console.log(`有效代理`, _.map(proxies, 'proxy'))
8
139
  console.log(`已檢測有效代理共 ${_.size(proxies)} 個...`)
140
+
141
+
142
+
143
+
144
+ <h5 class="h5-parameters">Parameters:</h5>
145
+
146
+
147
+ <table class="params">
148
+ <thead>
149
+ <tr>
150
+
151
+ <th>Name</th>
152
+
153
+
154
+ <th>Type</th>
155
+
156
+
157
+ <th>Attributes</th>
158
+
159
+
160
+
161
+ <th>Default</th>
162
+
163
+
164
+ <th class="last">Description</th>
165
+ </tr>
166
+ </thead>
167
+
168
+ <tbody>
169
+
170
+
171
+ <tr>
172
+
173
+ <td class="name"><code>opt</code></td>
174
+
175
+
176
+ <td class="type">
177
+
178
+
179
+ <span class="param-type">Object</span>
180
+
181
+
182
+
183
+
184
+ </td>
185
+
186
+
187
+ <td class="attributes">
188
+
189
+ &lt;optional><br>
190
+
191
+
192
+
193
+
194
+
195
+ </td>
196
+
197
+
198
+
199
+ <td class="default">
200
+
201
+ <code>{}</code>
202
+
203
+ </td>
204
+
205
+
206
+ <td class="description last"><p>輸入設定物件,預設{}</p>
207
+ <h6>Properties</h6>
208
+
209
+
210
+ <table class="params">
211
+ <thead>
212
+ <tr>
213
+
214
+ <th>Name</th>
215
+
216
+
217
+ <th>Type</th>
218
+
219
+
220
+ <th>Attributes</th>
221
+
222
+
223
+
224
+ <th>Default</th>
225
+
226
+
227
+ <th class="last">Description</th>
228
+ </tr>
229
+ </thead>
230
+
231
+ <tbody>
232
+
233
+
234
+ <tr>
235
+
236
+ <td class="name"><code>src</code></td>
237
+
238
+
239
+ <td class="type">
240
+
241
+
242
+ <span class="param-type">String</span>
243
+
244
+
245
+
246
+
247
+ </td>
248
+
249
+
250
+ <td class="attributes">
251
+
252
+ &lt;optional><br>
253
+
254
+
255
+
256
+
257
+
258
+ </td>
259
+
260
+
261
+
262
+ <td class="default">
263
+
264
+ <code>'https://api.proxyscrape.com/v2/?request=displayproxies&amp;protocol=http&amp;timeout=5000&amp;anonymity=all'</code>
265
+
266
+ </td>
267
+
268
+
269
+ <td class="description last"><p>輸入取得代理伺服器API字串,預設'https://api.proxyscrape.com/v2/?request=displayproxies&amp;protocol=http&amp;timeout=5000&amp;anonymity=all'</p></td>
270
+ </tr>
271
+
272
+
273
+
274
+ <tr>
275
+
276
+ <td class="name"><code>tar</code></td>
277
+
278
+
279
+ <td class="type">
280
+
281
+
282
+ <span class="param-type">String</span>
283
+
284
+
285
+
286
+
287
+ </td>
288
+
289
+
290
+ <td class="attributes">
291
+
292
+ &lt;optional><br>
293
+
294
+
295
+
296
+
297
+
298
+ </td>
299
+
300
+
301
+
302
+ <td class="default">
303
+
304
+ <code>'https://httpbin.org/ip'</code>
305
+
306
+ </td>
307
+
308
+
309
+ <td class="description last"><p>輸入檢測目標網址字串,預設'https://httpbin.org/ip'</p></td>
310
+ </tr>
311
+
312
+
313
+
314
+ <tr>
315
+
316
+ <td class="name"><code>timeGetProxies</code></td>
317
+
318
+
319
+ <td class="type">
320
+
321
+
322
+ <span class="param-type">Integer</span>
323
+
324
+
325
+
326
+
327
+ </td>
328
+
329
+
330
+ <td class="attributes">
331
+
332
+ &lt;optional><br>
333
+
334
+
335
+
336
+
337
+
338
+ </td>
339
+
340
+
341
+
342
+ <td class="default">
343
+
344
+ <code>30*1000</code>
345
+
346
+ </td>
347
+
348
+
349
+ <td class="description last"><p>輸入輪循抓取代理伺服器時間間隔整數,單位ms,預設30*1000</p></td>
350
+ </tr>
351
+
352
+
353
+
354
+ <tr>
355
+
356
+ <td class="name"><code>timeTestProxies</code></td>
357
+
358
+
359
+ <td class="type">
360
+
361
+
362
+ <span class="param-type">Integer</span>
363
+
364
+
365
+
366
+
367
+ </td>
368
+
369
+
370
+ <td class="attributes">
371
+
372
+ &lt;optional><br>
373
+
374
+
375
+
376
+
377
+
378
+ </td>
379
+
380
+
381
+
382
+ <td class="default">
383
+
384
+ <code>60*1000</code>
385
+
386
+ </td>
387
+
388
+
389
+ <td class="description last"><p>輸入輪循測試代理伺服器時間間隔整數,單位ms,預設60*1000</p></td>
390
+ </tr>
391
+
392
+
393
+
394
+ <tr>
395
+
396
+ <td class="name"><code>withServer</code></td>
397
+
398
+
399
+ <td class="type">
400
+
401
+
402
+ <span class="param-type">Boolean</span>
403
+
404
+
405
+
406
+
407
+ </td>
408
+
409
+
410
+ <td class="attributes">
411
+
412
+ &lt;optional><br>
413
+
414
+
415
+
416
+
417
+
418
+ </td>
419
+
420
+
421
+
422
+ <td class="default">
423
+
424
+ <code>false</code>
425
+
426
+ </td>
427
+
428
+
429
+ <td class="description last"><p>輸入是否創建供數據供給伺服器布林值,預設false</p></td>
430
+ </tr>
431
+
432
+
433
+
434
+ <tr>
435
+
436
+ <td class="name"><code>serverPort</code></td>
437
+
438
+
439
+ <td class="type">
440
+
441
+
442
+ <span class="param-type">Integer</span>
443
+
444
+
445
+
446
+
447
+ </td>
448
+
449
+
450
+ <td class="attributes">
451
+
452
+ &lt;optional><br>
453
+
454
+
455
+
456
+
457
+
458
+ </td>
459
+
460
+
461
+
462
+ <td class="default">
463
+
464
+ <code>8080</code>
465
+
466
+ </td>
467
+
468
+
469
+ <td class="description last"><p>輸入創建伺服器所用port整數,預設8080</p></td>
470
+ </tr>
471
+
472
+
473
+
474
+ <tr>
475
+
476
+ <td class="name"><code>serverApiName</code></td>
477
+
478
+
479
+ <td class="type">
480
+
481
+
482
+ <span class="param-type">String</span>
483
+
484
+
485
+
486
+
487
+ </td>
488
+
489
+
490
+ <td class="attributes">
491
+
492
+ &lt;optional><br>
493
+
494
+
495
+
496
+
497
+
498
+ </td>
499
+
500
+
501
+
502
+ <td class="default">
503
+
504
+ <code>'getProxies'</code>
505
+
506
+ </td>
507
+
508
+
509
+ <td class="description last"><p>輸入供給數據API名稱字串,預設'getProxies'</p></td>
510
+ </tr>
511
+
512
+
513
+
514
+ <tr>
515
+
516
+ <td class="name"><code>serverCorsOrigins</code></td>
517
+
518
+
519
+ <td class="type">
520
+
521
+
522
+ <span class="param-type">Array</span>
523
+
524
+
525
+
526
+
527
+ </td>
528
+
529
+
530
+ <td class="attributes">
531
+
532
+ &lt;optional><br>
533
+
534
+
535
+
536
+
537
+
538
+ </td>
539
+
540
+
541
+
542
+ <td class="default">
543
+
544
+ <code>['*']</code>
545
+
546
+ </td>
547
+
548
+
549
+ <td class="description last"><p>輸入允許跨域網域陣列,若給予['<em>']代表允許全部,預設['</em>']</p></td>
550
+ </tr>
551
+
552
+
553
+ </tbody>
554
+ </table>
555
+
556
+ </td>
557
+ </tr>
558
+
559
+
560
+ </tbody>
561
+ </table>
562
+
563
+
564
+
565
+
566
+
567
+
568
+
569
+
570
+
571
+
572
+
573
+
574
+
575
+
576
+
577
+
578
+ <h5 class="h5-returns">Returns:</h5>
579
+
580
+
581
+ <div class="param-desc">
582
+ <p>回傳事件物件,提供函數getProxies,可監聽事件getRawProxies、add、delete、change</p>
583
+ </div>
584
+
585
+
586
+
587
+ <dl class="param-type">
588
+ <dt>
589
+ Type
590
+ </dt>
591
+ <dd>
592
+
593
+ <span class="param-type">Object</span>
594
+
595
+
596
+
597
+ </dd>
598
+ </dl>
599
+
600
+
601
+
602
+
603
+
604
+
605
+ </div>
606
+
607
+
608
+
609
+
610
+
611
+
612
+
613
+
614
+
615
+
616
+
617
+
618
+
619
+
620
+
621
+
622
+
623
+
624
+
625
+
626
+
627
+ </article>
628
+
629
+ </section>
630
+
631
+
632
+
633
+
634
+
635
+
636
+ </div>
637
+
638
+ <br class="clear">
639
+
640
+ <footer>
641
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Fri Mar 21 2025 12:49:33 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
642
+ </footer>
643
+
644
+ <script>prettyPrint();</script>
645
+ <script src="scripts/polyfill.js"></script>
646
+ <script src="scripts/linenumber.js"></script>
647
+
648
+
649
+
650
+ </body>
651
+ </html>