w-ipproxy 1.0.18 → 1.0.20
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.
- package/dist/w-ipproxy.umd.js +2 -2
- package/dist/w-ipproxy.umd.js.map +1 -1
- package/docs/WIpProxy.html +70 -7
- package/docs/WIpProxy.mjs.html +610 -517
- package/docs/index.html +1 -1
- package/package.json +4 -4
- package/src/WIpProxy.mjs +609 -516
- package/test/anonymity.test.mjs +3 -3
- package/toolg/gDistRollup.mjs +4 -0
package/docs/WIpProxy.html
CHANGED
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
|
|
81
81
|
<dt class="tag-source">Source:</dt>
|
|
82
82
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
83
|
-
<a href="WIpProxy.mjs.html">WIpProxy.mjs</a>, <a href="WIpProxy.mjs.html#
|
|
83
|
+
<a href="WIpProxy.mjs.html">WIpProxy.mjs</a>, <a href="WIpProxy.mjs.html#line78">line 78</a>
|
|
84
84
|
</li></ul></dd>
|
|
85
85
|
|
|
86
86
|
|
|
@@ -127,7 +127,30 @@
|
|
|
127
127
|
|
|
128
128
|
<h5 class="h5-examples">Example</h5>
|
|
129
129
|
|
|
130
|
-
<pre class="prettyprint"><code>import _ from 'lodash-es'
|
|
131
130
|
// tar: `https://www.google.com`,
|
|
132
131
|
withServer: true,
|
|
133
132
|
serverPort: 9000,
|
|
134
133
|
serverCorsOrigins: ['*'],
|
|
135
134
|
console.log(`已抓取公開代理共 ${_.size(prxsRaw)} 個...`)
|
|
136
135
|
// console.log('新加入代理', { host: p.host, port: p.port }, _.map(proxies, 'proxy'))
|
|
137
136
|
// console.log('刪除代理', { host: p.host, port: p.port }, _.map(proxies, 'proxy'))
|
|
138
137
|
// console.log(`有效代理`, _.map(proxies, 'proxy'))
|
|
139
138
|
console.log(`已檢測有效代理共 ${_.size(proxies)} 個...`)
|
|
139
|
+
<pre class="prettyprint"><code>import _ from 'lodash-es'
|
|
140
|
+
import wip from './src/WIpProxy.mjs'
|
|
141
|
+
|
|
142
|
+
let wo = wip({
|
|
143
|
+
// tar: `https://www.google.com`,
|
|
144
|
+
withServer: true,
|
|
145
|
+
serverPort: 9000,
|
|
146
|
+
serverCorsOrigins: ['*'],
|
|
147
|
+
})
|
|
148
|
+
wo.on('getRawProxies', (prxsRaw) => {
|
|
149
|
+
console.log(`已抓取公開代理共 ${_.size(prxsRaw)} 個...`)
|
|
150
|
+
})
|
|
151
|
+
wo.on('add', (p, proxies) => {
|
|
152
|
+
// console.log('新加入代理', { host: p.host, port: p.port }, _.map(proxies, 'proxy'))
|
|
153
|
+
})
|
|
154
|
+
wo.on('delete', (p, proxies) => {
|
|
155
|
+
// console.log('刪除代理', { host: p.host, port: p.port }, _.map(proxies, 'proxy'))
|
|
156
|
+
})
|
|
157
|
+
wo.on('change', (proxies) => {
|
|
158
|
+
// console.log(`有效代理`, _.map(proxies, 'proxy'))
|
|
159
|
+
console.log(`已檢測有效代理共 ${_.size(proxies)} 個...`)
|
|
160
|
+
})
|
|
161
|
+
|
|
162
|
+
//browser view: http://localhost:9000/getProxies</code></pre>
|
|
140
163
|
|
|
141
164
|
|
|
142
165
|
|
|
@@ -417,7 +440,7 @@
|
|
|
417
440
|
</td>
|
|
418
441
|
|
|
419
442
|
|
|
420
|
-
<td class="description last"><p
|
|
443
|
+
<td class="description last"><p>輸入是否對代理做匿名性檢測布林值,開啟時會先查詢本機真實公網IP(依序嘗試httpbin.org、ipify、checkip.amazonaws.com、icanhazip.com),再透過代理打https://httpbin.org/get驗證目標端所見之origin與X-Forwarded-For、X-Real-IP、Forwarded等標頭皆不含本機真實IP,且不帶Via、Proxy-Connection等暴露代理存在之標頭;若本機真實IP查詢全部失敗則視為無法驗證,該回合所有代理皆不放行(fail-closed),預設true</p></td>
|
|
421
444
|
</tr>
|
|
422
445
|
|
|
423
446
|
|
|
@@ -452,12 +475,52 @@
|
|
|
452
475
|
|
|
453
476
|
<td class="default">
|
|
454
477
|
|
|
455
|
-
<code>
|
|
478
|
+
<code>5</code>
|
|
479
|
+
|
|
480
|
+
</td>
|
|
481
|
+
|
|
482
|
+
|
|
483
|
+
<td class="description last"><p>輸入匿名性檢測重複次數整數,各次以獨立連線送出並於時間上分散(間隔anonymityCheckInterval),用以偵測負載平衡型代理呈時間窗之機率性洩漏,任一次洩漏即判定失敗,預設5</p></td>
|
|
484
|
+
</tr>
|
|
485
|
+
|
|
486
|
+
|
|
487
|
+
|
|
488
|
+
<tr>
|
|
489
|
+
|
|
490
|
+
<td class="name"><code>anonymityCheckInterval</code></td>
|
|
491
|
+
|
|
492
|
+
|
|
493
|
+
<td class="type">
|
|
494
|
+
|
|
495
|
+
|
|
496
|
+
<span class="param-type">Integer</span>
|
|
497
|
+
|
|
498
|
+
|
|
499
|
+
|
|
500
|
+
|
|
501
|
+
</td>
|
|
502
|
+
|
|
503
|
+
|
|
504
|
+
<td class="attributes">
|
|
505
|
+
|
|
506
|
+
<optional><br>
|
|
507
|
+
|
|
508
|
+
|
|
509
|
+
|
|
510
|
+
|
|
511
|
+
|
|
512
|
+
</td>
|
|
513
|
+
|
|
514
|
+
|
|
515
|
+
|
|
516
|
+
<td class="default">
|
|
517
|
+
|
|
518
|
+
<code>2000</code>
|
|
456
519
|
|
|
457
520
|
</td>
|
|
458
521
|
|
|
459
522
|
|
|
460
|
-
<td class="description last"><p
|
|
523
|
+
<td class="description last"><p>輸入匿名性檢測各次之間隔時間整數,單位ms,預設2000</p></td>
|
|
461
524
|
</tr>
|
|
462
525
|
|
|
463
526
|
|
|
@@ -650,7 +713,7 @@
|
|
|
650
713
|
|
|
651
714
|
|
|
652
715
|
<div class="param-desc">
|
|
653
|
-
<p>回傳事件物件,提供函數getProxies,可監聽事件getRawProxies、add、delete、change</p>
|
|
716
|
+
<p>回傳事件物件,提供函數getProxies(等待至有有效代理)與getProxiesOnce(抓取並檢測一回合後回傳當前有效代理,可能為空陣列),可監聽事件getRawProxies、add、delete、change</p>
|
|
654
717
|
</div>
|
|
655
718
|
|
|
656
719
|
|
|
@@ -709,7 +772,7 @@
|
|
|
709
772
|
<br class="clear">
|
|
710
773
|
|
|
711
774
|
<footer>
|
|
712
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on
|
|
775
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Sat Sep 05 2026 22:11:39 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
713
776
|
</footer>
|
|
714
777
|
|
|
715
778
|
<script>prettyPrint();</script>
|