pac-proxy-cli 0.1.4 → 0.1.5

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/.env CHANGED
@@ -1,3 +1,3 @@
1
1
  # 远程代理服务器地址(用于登录、PAC 同步等)
2
2
  # 面板通过 /api/config 读取此配置,前端不展示该地址
3
- PROXY_SERVER_URL=http://proxy.ah.lonae.com
3
+ PROXY_SERVER_URL=http://ah.lonae.com:3890
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pac-proxy-cli",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "HTTP 代理与隧道 CLI + Web 管理面板",
5
5
  "type": "module",
6
6
  "files": [
package/public/index.html CHANGED
@@ -567,6 +567,17 @@
567
567
  return (n / 1024 / 1024).toFixed(1) + ' MB';
568
568
  }
569
569
 
570
+ function formatTrafficUrl(item) {
571
+ const raw = item.url || item.host || '';
572
+ if (!raw) return '-';
573
+ if (item.method === 'CONNECT' && /^[^\/]+:\d+$/.test(raw)) {
574
+ const [h, p] = raw.split(':');
575
+ const port = parseInt(p, 10);
576
+ return port === 443 ? `https://${h}` : `https://${h}:${port}`;
577
+ }
578
+ const s = String(raw).slice(0, 60);
579
+ return s + (raw.length > 60 ? '…' : '');
580
+ }
570
581
  async function loadTraffic() {
571
582
  try {
572
583
  const r = await fetch('/api/capture');
@@ -576,7 +587,7 @@
576
587
  <tr>
577
588
  <td>${formatTime(item.time)}</td>
578
589
  <td>${item.method}</td>
579
- <td title="${(item.url || item.host || '').slice(0, 200)}">${(item.url || item.host || '-').slice(0, 60)}${(item.url && item.url.length > 60 ? '…' : '')}</td>
590
+ <td title="${(item.url || item.host || '').slice(0, 200)}">${formatTrafficUrl(item)}</td>
580
591
  <td class="${statusClass(item.statusCode)}">${item.statusCode ?? '-'}</td>
581
592
  <td>${item.proxyDecision ?? '代理'}</td>
582
593
  <td>${sizeStr(item.responseBodySize)}</td>