-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
982 lines (855 loc) · 38.1 KB
/
index.html
File metadata and controls
982 lines (855 loc) · 38.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="一站式住宅 IP 检测工具 - 多源数据库交叉验证,判断您的 IP 是否为干净的静态住宅 IP">
<meta name="keywords" content="住宅IP检测,Residential IP,静态住宅IP,IP检测工具,代理检测,VPN检测">
<title>住宅 IP 检测工具 - Residential IP Checker</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap"
rel="stylesheet">
<style>
:root {
--bg-primary: #0a0e1a;
--bg-card: #1a2035;
--bg-card-hover: #1f2847;
--border-color: rgba(99, 102, 241, 0.15);
--border-glow: rgba(99, 102, 241, 0.4);
--text-primary: #f1f5f9;
--text-secondary: #94a3b8;
--text-muted: #64748b;
--accent-blue: #6366f1;
--accent-purple: #8b5cf6;
--accent-cyan: #22d3ee;
--green: #22c55e;
--green-bg: rgba(34, 197, 94, 0.1);
--green-border: rgba(34, 197, 94, 0.3);
--red: #ef4444;
--red-bg: rgba(239, 68, 68, 0.1);
--red-border: rgba(239, 68, 68, 0.3);
--yellow: #eab308;
--yellow-bg: rgba(234, 179, 8, 0.1);
--yellow-border: rgba(234, 179, 8, 0.3);
}
* {
margin: 0;
padding: 0;
box-sizing: border-box
}
body {
font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
background: var(--bg-primary);
color: var(--text-primary);
min-height: 100vh;
line-height: 1.6;
}
body::before {
content: '';
position: fixed;
top: 0;
left: 0;
right: 0;
height: 600px;
background: radial-gradient(ellipse at 50% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
pointer-events: none;
}
.wrapper {
max-width: 920px;
margin: 0 auto;
padding: 40px 20px 60px;
position: relative;
z-index: 1
}
/* Header */
.header {
text-align: center;
margin-bottom: 40px
}
.header h1 {
font-size: 32px;
font-weight: 800;
background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple), var(--accent-cyan));
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
margin-bottom: 10px;
letter-spacing: -0.5px;
}
.header .subtitle {
color: var(--text-secondary);
font-size: 15px;
max-width: 600px;
margin: 0 auto
}
/* Loading */
.loading-container {
text-align: center;
padding: 80px 20px
}
.loading-spinner {
width: 48px;
height: 48px;
border: 3px solid var(--border-color);
border-top-color: var(--accent-blue);
border-radius: 50%;
animation: spin .8s linear infinite;
margin: 0 auto 24px;
}
@keyframes spin {
to {
transform: rotate(360deg)
}
}
.loading-text {
color: var(--text-secondary);
font-size: 15px
}
.loading-sub {
color: var(--text-muted);
font-size: 13px;
margin-top: 8px
}
.loading-progress {
margin-top: 16px;
font-size: 13px;
color: var(--accent-blue)
}
/* Verdict Banner */
.verdict-banner {
border-radius: 16px;
padding: 32px;
margin-bottom: 24px;
text-align: center;
border: 1px solid;
position: relative;
overflow: hidden;
}
.verdict-banner::before {
content: '';
position: absolute;
inset: 0;
opacity: 0.05;
background: radial-gradient(circle at 50% 50%, currentColor 0%, transparent 70%);
}
.verdict-banner.pass {
background: var(--green-bg);
border-color: var(--green-border);
color: var(--green)
}
.verdict-banner.fail {
background: var(--red-bg);
border-color: var(--red-border);
color: var(--red)
}
.verdict-banner.warn {
background: var(--yellow-bg);
border-color: var(--yellow-border);
color: var(--yellow)
}
.verdict-icon {
font-size: 48px;
margin-bottom: 12px
}
.verdict-title {
font-size: 24px;
font-weight: 800;
margin-bottom: 8px
}
.verdict-subtitle {
font-size: 14px;
opacity: 0.85;
max-width: 550px;
margin: 0 auto;
line-height: 1.7
}
/* IP Info Bar */
.ip-info-bar {
background: var(--bg-card);
border: 1px solid var(--border-color);
border-radius: 12px;
padding: 20px 24px;
margin-bottom: 24px;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
gap: 16px;
}
.ip-info-item {
display: flex;
flex-direction: column;
gap: 4px
}
.ip-info-label {
font-size: 12px;
color: var(--text-muted);
text-transform: uppercase;
letter-spacing: .5px;
font-weight: 600
}
.ip-info-value {
font-size: 15px;
color: var(--text-primary);
font-weight: 600;
word-break: break-all
}
.ip-info-value.ip-address {
font-size: 18px;
background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
/* Reasons */
.reasons-box {
background: var(--bg-card);
border: 1px solid var(--border-color);
border-radius: 12px;
padding: 20px 24px;
margin-bottom: 24px;
}
.reasons-title {
font-size: 15px;
font-weight: 700;
color: var(--text-primary);
margin-bottom: 12px;
display: flex;
align-items: center;
gap: 8px
}
.reason-item {
display: flex;
align-items: flex-start;
gap: 10px;
padding: 10px 0;
border-bottom: 1px solid rgba(255, 255, 255, 0.05);
font-size: 14px;
color: var(--text-secondary);
}
.reason-item:last-child {
border-bottom: none;
padding-bottom: 0
}
.reason-icon {
flex-shrink: 0;
width: 20px;
height: 20px;
display: flex;
align-items: center;
justify-content: center;
font-size: 13px
}
/* Detection Cards */
.cards-title {
font-size: 18px;
font-weight: 700;
color: var(--text-primary);
margin-bottom: 16px;
display: flex;
align-items: center;
gap: 8px
}
.cards-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
gap: 16px;
margin-bottom: 32px
}
.detection-card {
background: var(--bg-card);
border: 1px solid var(--border-color);
border-radius: 12px;
padding: 20px;
transition: all .3s ease;
}
.detection-card:hover {
border-color: var(--border-glow);
background: var(--bg-card-hover);
transform: translateY(-2px);
box-shadow: 0 8px 32px rgba(99, 102, 241, 0.1);
}
.card-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 16px
}
.card-source {
font-size: 14px;
font-weight: 700;
color: var(--text-primary)
}
.card-source small {
font-weight: 400;
color: var(--text-muted);
font-size: 11px;
display: block;
margin-top: 2px
}
.card-badge {
font-size: 11px;
font-weight: 700;
padding: 4px 10px;
border-radius: 20px;
text-transform: uppercase;
letter-spacing: .5px
}
.card-badge.pass {
background: var(--green-bg);
color: var(--green);
border: 1px solid var(--green-border)
}
.card-badge.fail {
background: var(--red-bg);
color: var(--red);
border: 1px solid var(--red-border)
}
.card-badge.loading {
background: rgba(99, 102, 241, 0.1);
color: var(--accent-blue);
border: 1px solid rgba(99, 102, 241, 0.3)
}
.card-badge.warn {
background: var(--yellow-bg);
color: var(--yellow);
border: 1px solid var(--yellow-border)
}
.card-checks {
display: flex;
flex-direction: column;
gap: 8px
}
.check-row {
display: flex;
align-items: center;
justify-content: space-between;
font-size: 13px
}
.check-label {
color: var(--text-secondary)
}
.check-value {
font-weight: 600;
display: flex;
align-items: center;
gap: 4px
}
.check-value.good {
color: var(--green)
}
.check-value.bad {
color: var(--red)
}
.check-value.neutral {
color: var(--text-muted)
}
.mini-spinner {
width: 14px;
height: 14px;
border: 2px solid var(--border-color);
border-top-color: var(--accent-blue);
border-radius: 50%;
animation: spin .8s linear infinite;
display: inline-block;
}
/* Deep Scan */
.deep-scan-section {
margin-top: 32px
}
.deep-scan-title {
font-size: 18px;
font-weight: 700;
color: var(--text-primary);
margin-bottom: 6px;
display: flex;
align-items: center;
gap: 8px
}
.deep-scan-subtitle {
font-size: 13px;
color: var(--text-muted);
margin-bottom: 16px
}
.deep-links-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
gap: 12px
}
.deep-link {
display: flex;
align-items: center;
gap: 14px;
padding: 16px;
background: var(--bg-card);
border: 1px solid var(--border-color);
border-radius: 12px;
text-decoration: none;
color: var(--text-primary);
transition: all .3s ease;
}
.deep-link:hover {
border-color: var(--border-glow);
background: var(--bg-card-hover);
transform: translateY(-2px);
box-shadow: 0 8px 32px rgba(99, 102, 241, 0.1);
}
.deep-link-icon {
width: 40px;
height: 40px;
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
font-size: 20px;
flex-shrink: 0;
background: rgba(99, 102, 241, 0.1);
}
.deep-link-info {
flex: 1;
min-width: 0
}
.deep-link-name {
font-size: 14px;
font-weight: 600;
margin-bottom: 2px
}
.deep-link-desc {
font-size: 12px;
color: var(--text-muted);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis
}
.deep-link-arrow {
color: var(--text-muted);
font-size: 14px;
flex-shrink: 0;
transition: transform .2s
}
.deep-link:hover .deep-link-arrow {
transform: translateX(3px);
color: var(--accent-blue)
}
/* Footer */
.page-footer {
margin-top: 48px;
text-align: center;
color: var(--text-muted);
font-size: 13px;
padding-top: 24px;
border-top: 1px solid var(--border-color)
}
.page-footer a {
color: var(--accent-blue);
text-decoration: none
}
.page-footer a:hover {
color: var(--accent-cyan)
}
.fade-in {
animation: fadeIn .5s ease-out
}
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(10px)
}
to {
opacity: 1;
transform: translateY(0)
}
}
@media(max-width:640px) {
.wrapper {
padding: 24px 16px 40px
}
.header h1 {
font-size: 24px
}
.verdict-banner {
padding: 24px 16px
}
.verdict-title {
font-size: 20px
}
.ip-info-bar {
grid-template-columns: 1fr 1fr
}
.cards-grid,
.deep-links-grid {
grid-template-columns: 1fr
}
}
</style>
</head>
<body>
<div class="wrapper">
<div class="header">
<h1>🏠 住宅 IP 检测工具</h1>
<p class="subtitle">多源数据库交叉验证,一秒判断您的 IP 是否为干净的静态住宅 IP</p>
</div>
<div id="loadingState" class="loading-container">
<div class="loading-spinner"></div>
<div class="loading-text">正在从多个数据库检测您的 IP...</div>
<div class="loading-sub">ipinfo.io · ipapi.is · freeipapi.com</div>
<div class="loading-progress" id="loadingProgress"></div>
</div>
<div id="resultsContainer" style="display:none;">
<div id="verdictBanner" class="verdict-banner warn fade-in">
<div class="verdict-icon" id="verdictIcon">⏳</div>
<div class="verdict-title" id="verdictTitle">正在综合分析...</div>
<div class="verdict-subtitle" id="verdictSubtitle">等待所有检测数据返回</div>
</div>
<div id="reasonsBox" class="reasons-box fade-in" style="display:none;">
<div class="reasons-title">⚠️ 未通过原因</div>
<div id="reasonsList"></div>
</div>
<div class="ip-info-bar fade-in">
<div class="ip-info-item"><span class="ip-info-label">IP 地址</span><span class="ip-info-value ip-address"
id="ipAddr">—</span></div>
<div class="ip-info-item"><span class="ip-info-label">地理位置</span><span class="ip-info-value"
id="ipLocation">—</span></div>
<div class="ip-info-item"><span class="ip-info-label">ISP 运营商</span><span class="ip-info-value"
id="ipISP">—</span></div>
<div class="ip-info-item"><span class="ip-info-label">ASN</span><span class="ip-info-value"
id="ipASN">—</span></div>
</div>
<div class="cards-title">📊 多源检测结果</div>
<div class="cards-grid">
<div class="detection-card" id="card-ipinfo">
<div class="card-header">
<div class="card-source">ipinfo.io<small>IP 归属 & ISP 情报</small></div>
<span class="card-badge loading" id="badge-ipinfo"><span class="mini-spinner"></span></span>
</div>
<div class="card-checks" id="checks-ipinfo">
<div class="check-row"><span class="check-label">ISP 类型</span><span
class="check-value neutral"><span class="mini-spinner"></span></span></div>
<div class="check-row"><span class="check-label">运营商</span><span
class="check-value neutral"><span class="mini-spinner"></span></span></div>
</div>
</div>
<div class="detection-card" id="card-ipapis">
<div class="card-header">
<div class="card-source">ipapi.is<small>数据中心 & VPN 检测</small></div>
<span class="card-badge loading" id="badge-ipapis"><span class="mini-spinner"></span></span>
</div>
<div class="card-checks" id="checks-ipapis">
<div class="check-row"><span class="check-label">数据中心</span><span
class="check-value neutral"><span class="mini-spinner"></span></span></div>
<div class="check-row"><span class="check-label">VPN</span><span
class="check-value neutral"><span class="mini-spinner"></span></span></div>
<div class="check-row"><span class="check-label">代理</span><span
class="check-value neutral"><span class="mini-spinner"></span></span></div>
<div class="check-row"><span class="check-label">Tor</span><span
class="check-value neutral"><span class="mini-spinner"></span></span></div>
</div>
</div>
<div class="detection-card" id="card-freeipapi">
<div class="card-header">
<div class="card-source">freeipapi.com<small>代理检测 & 地理验证</small></div>
<span class="card-badge loading" id="badge-freeipapi"><span class="mini-spinner"></span></span>
</div>
<div class="card-checks" id="checks-freeipapi">
<div class="check-row"><span class="check-label">代理检测</span><span
class="check-value neutral"><span class="mini-spinner"></span></span></div>
<div class="check-row"><span class="check-label">运营商</span><span
class="check-value neutral"><span class="mini-spinner"></span></span></div>
</div>
</div>
</div>
<div class="deep-scan-section fade-in">
<div class="deep-scan-title">🔍 深度检测工具</div>
<div class="deep-scan-subtitle">点击跳转至第三方专业检测平台,进一步验证 IP 质量(自动带入您的 IP)</div>
<div class="deep-links-grid" id="deepLinksGrid"></div>
</div>
</div>
<div class="page-footer">
<p>开源项目 · 数据来源于 ipinfo.io / ipapi.is / freeipapi.com · <a
href="https://github.com/xingjia10086/residential-ip-checker" target="_blank">GitHub</a></p>
</div>
</div>
<script>
(function () {
'use strict';
// ===================== State =====================
let userIP = '';
const results = { ipinfo: null, ipapis: null, freeipapi: null };
let completedAPIs = 0;
const TOTAL_APIS = 3;
// Datacenter keywords
const DC_KEYWORDS = [
'google', 'amazon', 'microsoft', 'digitalocean', 'linode', 'vultr', 'ovh',
'hetzner', 'cloudflare', 'alibaba', 'tencent', 'aws', 'azure', 'gcp', 'oracle',
'ibm', 'hosting', 'server', 'cloud', 'datacenter', 'data center', 'colocation',
'colo', 'vps', 'rackspace', 'kamatera', 'contabo', 'scaleway', 'upcloud',
'choopa', 'cogent', 'leaseweb', 'quadranet', 'psychz', 'multacom'
];
// Known residential ISPs
const RES_ISPS = [
'comcast', 'xfinity', 'at&t', 'att ', 'verizon', 'cox ', 'spectrum', 'charter',
'centurylink', 'frontier', 'optimum', 'mediacom', 'windstream', 'suddenlink',
'rcn', 'wow ', 'cable', 'broadband', 'telecom', 'communications',
'bt ', 'sky ', 'virgin media', 'orange', 'deutsche telekom', 'telefonica',
'vodafone', 'bell ', 'rogers', 'telus', 't-mobile', 'sprint'
];
// Deep scan links
const DEEP_LINKS = [
{ name: 'Scamalytics', desc: '欺诈风险评分(< 20 分为优)', icon: '🛡️', url: ip => `https://scamalytics.com/ip/${ip}` },
{ name: 'IPQualityScore', desc: '综合 IP 质量、代理、VPN 检测', icon: '📊', url: ip => `https://www.ipqualityscore.com/free-ip-lookup-proxy-vpn-test/lookup/${ip}` },
{ name: 'IP2Location', desc: '查看 Usage Type(ISP = 住宅)', icon: '🌍', url: ip => `https://www.ip2location.com/demo/${ip}` },
{ name: 'Whoer.net', desc: '匿名度检测(时区、DNS 泄露)', icon: '🕵️', url: () => 'https://whoer.net/' },
{ name: 'AbuseIPDB', desc: 'IP 恶意行为举报记录', icon: '🚨', url: ip => `https://www.abuseipdb.com/check/${ip}` },
{ name: 'PixelScan', desc: '浏览器指纹一致性检测', icon: '🔬', url: () => 'https://pixelscan.net/' }
];
// ===================== Helpers =====================
const $ = id => document.getElementById(id);
function esc(s) { const d = document.createElement('div'); d.textContent = s; return d.innerHTML; }
function boolCheck(v) { return v ? '<span class="check-value bad">❌ 是</span>' : '<span class="check-value good">✅ 否</span>'; }
function textVal(s) { return `<span class="check-value neutral">${esc(s)}</span>`; }
function setIP(ip) { if (!userIP && ip) userIP = ip; }
function fillInfo(field, value) { const el = $(field); if (el && (!el.textContent || el.textContent === '—') && value && value !== '—') el.textContent = value; }
function setBadge(id, state) {
const el = $(id);
el.className = `card-badge ${state}`;
el.textContent = state === 'pass' ? '通过' : state === 'fail' ? '未通过' : '超时';
}
function setCardError(cardId, name) {
setBadge('badge-' + cardId, 'warn');
$('checks-' + cardId).innerHTML = `<div class="check-row"><span class="check-label" style="color:var(--yellow)">${esc(name)} 请求失败或超时</span></div>`;
}
function updateProgress(msg) { const el = $('loadingProgress'); if (el) el.textContent = msg; }
// Fetch with timeout
function fetchWithTimeout(url, ms = 8000) {
const ctrl = new AbortController();
const timer = setTimeout(() => ctrl.abort(), ms);
return fetch(url, { signal: ctrl.signal }).finally(() => clearTimeout(timer));
}
// ===================== API 1: ipinfo.io =====================
// HTTPS, free 50k/month, CORS: *, returns IP + geo + org (ASN embedded in org)
async function fetchIpinfo() {
try {
updateProgress('正在连接 ipinfo.io...');
const res = await fetchWithTimeout('https://ipinfo.io/json');
const d = await res.json();
setIP(d.ip);
// d.org format: "AS701 Verizon Business"
const orgRaw = d.org || '';
const asnMatch = orgRaw.match(/^(AS\d+)\s*(.*)/);
const asn = asnMatch ? asnMatch[1] : '—';
const isp = asnMatch ? asnMatch[2] : orgRaw || '—';
const org = orgRaw.toLowerCase();
const isHosting = DC_KEYWORDS.some(kw => org.includes(kw));
const isRes = RES_ISPS.some(kw => org.includes(kw));
const loc = [d.city, d.region, d.country].filter(Boolean).join(', ') || '—';
results.ipinfo = {
ip: d.ip, location: loc, isp, org,
asn: asn !== '—' ? `${asn} ${isp}`.trim() : '—',
isHosting, isResidential: isRes
};
// Fill info bar
fillInfo('ipAddr', d.ip);
fillInfo('ipLocation', loc);
fillInfo('ipISP', isp);
fillInfo('ipASN', results.ipinfo.asn);
// Render card
setBadge('badge-ipinfo', isHosting ? 'fail' : 'pass');
$('checks-ipinfo').innerHTML = `
<div class="check-row"><span class="check-label">ISP 类型</span>
<span class="check-value ${isRes ? 'good' : (isHosting ? 'bad' : 'neutral')}">
${isRes ? '🏠 住宅 ISP' : (isHosting ? '🏢 数据中心' : '❓ 未知类型')}
</span>
</div>
<div class="check-row"><span class="check-label">运营商</span>${textVal(isp)}</div>
<div class="check-row"><span class="check-label">地区</span>${textVal(loc)}</div>
`;
} catch (e) {
console.warn('ipinfo.io error:', e);
results.ipinfo = { error: true };
setCardError('ipinfo', 'ipinfo.io');
}
onComplete();
}
// ===================== API 2: ipapi.is =====================
// HTTPS, free, no key, proven CORS-friendly (confirmed working)
async function fetchIpapiIs() {
try {
updateProgress('正在连接 ipapi.is...');
const res = await fetchWithTimeout('https://api.ipapi.is/');
const d = await res.json();
setIP(d.ip);
const r = {
ip: d.ip,
is_datacenter: !!d.is_datacenter,
is_vpn: !!d.is_vpn,
is_proxy: !!d.is_proxy,
is_tor: !!d.is_tor,
company_type: d.company?.type || '—',
company_name: d.company?.name || '—',
asn: d.asn?.asn ? `AS${d.asn.asn}` : '—',
asn_org: d.asn?.org || '—',
location: d.location ? [d.location.city, d.location.state, d.location.country].filter(Boolean).join(', ') : '—'
};
results.ipapis = r;
// Fill info bar as fallback
fillInfo('ipAddr', d.ip);
fillInfo('ipASN', r.asn !== '—' ? `${r.asn} ${r.asn_org}` : undefined);
fillInfo('ipISP', r.company_name !== '—' ? r.company_name : undefined);
fillInfo('ipLocation', r.location !== '—' ? r.location : undefined);
const pass = !r.is_datacenter && !r.is_vpn && !r.is_proxy && !r.is_tor;
setBadge('badge-ipapis', pass ? 'pass' : 'fail');
$('checks-ipapis').innerHTML = `
<div class="check-row"><span class="check-label">数据中心</span>${boolCheck(r.is_datacenter)}</div>
<div class="check-row"><span class="check-label">VPN</span>${boolCheck(r.is_vpn)}</div>
<div class="check-row"><span class="check-label">代理</span>${boolCheck(r.is_proxy)}</div>
<div class="check-row"><span class="check-label">Tor</span>${boolCheck(r.is_tor)}</div>
`;
} catch (e) {
console.warn('ipapi.is error:', e);
results.ipapis = { error: true };
setCardError('ipapis', 'ipapi.is');
}
onComplete();
}
// ===================== API 3: freeipapi.com =====================
// HTTPS, free, CORS: *, returns geo + ASN + isProxy detection
async function fetchFreeIpApi() {
try {
updateProgress('正在连接 freeipapi.com...');
const res = await fetchWithTimeout('https://freeipapi.com/api/json');
const d = await res.json();
setIP(d.ipAddress);
const isp = d.asnOrganization || '—';
const org = (d.asnOrganization || '').toLowerCase();
const isHosting = DC_KEYWORDS.some(kw => org.includes(kw));
const isRes = RES_ISPS.some(kw => org.includes(kw));
const loc = [d.cityName, d.regionName, d.countryName].filter(Boolean).join(', ') || '—';
const isProxy = !!d.isProxy;
results.freeipapi = {
ip: d.ipAddress, location: loc, isp, org,
asn: d.asn ? `AS${d.asn} ${isp}`.trim() : '—',
isHosting, isResidential: isRes, isProxy
};
// Fill info bar as fallback
fillInfo('ipAddr', d.ipAddress);
fillInfo('ipLocation', loc);
fillInfo('ipISP', isp);
fillInfo('ipASN', results.freeipapi.asn);
const pass = !isHosting && !isProxy;
setBadge('badge-freeipapi', pass ? 'pass' : 'fail');
$('checks-freeipapi').innerHTML = `
<div class="check-row"><span class="check-label">代理检测</span>${boolCheck(isProxy)}</div>
<div class="check-row"><span class="check-label">ISP 类型</span>
<span class="check-value ${isRes ? 'good' : (isHosting ? 'bad' : 'neutral')}">
${isRes ? '🏠 住宅 ISP' : (isHosting ? '🏢 数据中心' : '❓ 未知类型')}
</span>
</div>
<div class="check-row"><span class="check-label">运营商</span>${textVal(isp)}</div>
<div class="check-row"><span class="check-label">地区</span>${textVal(loc)}</div>
`;
} catch (e) {
console.warn('freeipapi.com error:', e);
results.freeipapi = { error: true };
setCardError('freeipapi', 'freeipapi.com');
}
onComplete();
}
// ===================== Verdict =====================
function onComplete() {
completedAPIs++;
if (completedAPIs === 1) {
$('loadingState').style.display = 'none';
$('resultsContainer').style.display = 'block';
renderDeepLinks();
}
// When IP available, update deep links
if (userIP) updateDeepLinks();
// Final verdict after all done
if (completedAPIs >= TOTAL_APIS) renderVerdict();
}
function renderVerdict() {
const reasons = [];
// ipinfo.io analysis
if (results.ipinfo && !results.ipinfo.error) {
if (results.ipinfo.isHosting) {
reasons.push(`ipinfo.io: ISP/组织名称 "${results.ipinfo.isp}" 含有数据中心关键词`);
}
}
// ipapi.is analysis (strongest signal)
if (results.ipapis && !results.ipapis.error) {
const r = results.ipapis;
if (r.is_datacenter) reasons.push('ipapi.is: 识别为数据中心 IP(is_datacenter = true)');
if (r.is_vpn) reasons.push('ipapi.is: 检测到 VPN 出口节点(is_vpn = true)');
if (r.is_proxy) reasons.push('ipapi.is: 检测到代理服务器(is_proxy = true)');
if (r.is_tor) reasons.push('ipapi.is: 检测到 Tor 网络(is_tor = true)');
if (r.company_type === 'hosting')
reasons.push(`ipapi.is: 公司类型为 "hosting"(机房/托管服务商)`);
}
// freeipapi.com analysis (proxy detection + cross-validation)
if (results.freeipapi && !results.freeipapi.error) {
if (results.freeipapi.isProxy) {
reasons.push('freeipapi.com: 检测到代理(isProxy = true)');
}
if (results.freeipapi.isHosting) {
reasons.push(`freeipapi.com: ISP/组织名称 "${results.freeipapi.isp}" 含有数据中心关键词`);
}
}
const errors = [results.ipinfo, results.ipapis, results.freeipapi].filter(r => r?.error).length;
const successes = TOTAL_APIS - errors;
if (reasons.length === 0 && successes >= 2) {
// PASS
$('verdictBanner').className = 'verdict-banner pass fade-in';
$('verdictIcon').textContent = '✅';
$('verdictTitle').textContent = '干净的静态住宅 IP';
const suffix = errors > 0
? `(${successes}/${TOTAL_APIS} 个数据源确认通过)。建议再通过下方深度检测工具做最终确认。`
: '。恭喜!所有数据源均确认通过,适合用于银行开户等敏感操作。';
$('verdictSubtitle').textContent = '您的 IP 通过了多源交叉验证' + suffix;
$('reasonsBox').style.display = 'none';
} else if (reasons.length === 0 && successes < 2) {
// WARN
$('verdictBanner').className = 'verdict-banner warn fade-in';
$('verdictIcon').textContent = '⚠️';
$('verdictTitle').textContent = '检测结果不充分';
$('verdictSubtitle').textContent = `仅 ${successes}/${TOTAL_APIS} 个数据源返回结果。已完成的检测全部通过,但建议使用下方深度检测工具进一步验证。`;
$('reasonsBox').style.display = 'none';
} else {
// FAIL
$('verdictBanner').className = 'verdict-banner fail fade-in';
$('verdictIcon').textContent = '❌';
$('verdictTitle').textContent = '非干净的静态住宅 IP';
$('verdictSubtitle').textContent = '您的 IP 未通过以下检测项,不建议用于银行开户等敏感操作:';
$('reasonsBox').style.display = 'block';
$('reasonsList').innerHTML = reasons.map(r =>
`<div class="reason-item"><span class="reason-icon">❌</span><span>${esc(r)}</span></div>`
).join('');
}
}
// ===================== Deep Links =====================
function renderDeepLinks() {
$('deepLinksGrid').innerHTML = DEEP_LINKS.map(l => `
<a href="${l.url(userIP || '')}" target="_blank" rel="noopener" class="deep-link" data-link="${l.name}">
<div class="deep-link-icon">${l.icon}</div>
<div class="deep-link-info">
<div class="deep-link-name">${l.name}</div>
<div class="deep-link-desc">${l.desc}</div>
</div>
<div class="deep-link-arrow">→</div>
</a>
`).join('');
}
function updateDeepLinks() {
if (!userIP) return;
DEEP_LINKS.forEach(l => {
const el = document.querySelector(`[data-link="${l.name}"]`);
if (el) el.href = l.url(userIP);
});
}
// ===================== Start =====================
// Fire all three APIs concurrently. All three can auto-detect the visitor's IP.
fetchIpinfo();
fetchIpapiIs();
fetchFreeIpApi();
})();
</script>
</body>
</html>