[GH-ISSUE #5137] [Feature Request] FRPS的web页面完善 #4019

Closed
opened 2026-05-05 14:33:08 -06:00 by gitea-mirror · 1 comment
Owner

Originally created by @wanjiban on GitHub (Jan 25, 2026).
Original GitHub issue: https://github.com/fatedier/frp/issues/5137

Describe the feature request

static/#/proxies/tcp等页面下的端口号位置,增加点击端口号跳转到对应的页面。
比如:点击 http://a.com:10000/static/#/proxies/tcp下的10050端口,则新的窗口跳转到http://a.com:10050

此举可以简化打开网页反代的流程。目前是通过油猴脚本解决的。希望大佬点我。

`// ==UserScript==
// @name FRP Port Clickable Link
// @namespace frp-port-linker
// @version 1.0
// @description Make FRP TCP port numbers clickable
// @match :///*
// @grant none
// ==/UserScript==

(function () {
'use strict';

const TARGET_PATH = '/static/#/proxies/tcp';

function isTargetPage() {
    return location.pathname + location.hash === TARGET_PATH;
}

function makePortLinks() {
    if (!isTargetPage()) return;

    const host = location.hostname;
    const protocol = location.protocol;

    const nodes = document.querySelectorAll('td, div, span');

    nodes.forEach(node => {
        if (node.dataset.frpLinked) return;

        const text = node.innerText?.trim();
        if (!text) return;

        // 匹配端口号(放宽到 1–65535 的合理长度)
        if (!/^\d{1,5}$/.test(text)) return;

        const port = Number(text);
        if (port < 1 || port > 65535) return;

        const a = document.createElement('a');
        a.href = `${protocol}//${host}:${port}/`;
        a.innerText = text;
        a.target = '_blank';
        a.style.color = '#409eff';
        a.style.textDecoration = 'underline';

        node.innerHTML = '';
        node.appendChild(a);
        node.dataset.frpLinked = '1';
    });
}

// 初次执行
makePortLinks();

// 监听 SPA DOM 变化
const observer = new MutationObserver(() => {
    makePortLinks();
});

observer.observe(document.body, {
    childList: true,
    subtree: true
});

})();
`

Describe alternatives you've considered

No response

Affected area

  • Docs
  • Installation
  • Performance and Scalability
  • Security
  • User Experience
  • Test and Release
  • Developer Infrastructure
  • Client Plugin
  • Server Plugin
  • Extensions
  • Others
Originally created by @wanjiban on GitHub (Jan 25, 2026). Original GitHub issue: https://github.com/fatedier/frp/issues/5137 ### Describe the feature request static/#/proxies/tcp等页面下的端口号位置,增加点击端口号跳转到对应的页面。 比如:点击 http://a.com:10000/static/#/proxies/tcp下的10050端口,则新的窗口跳转到http://a.com:10050 此举可以简化打开网页反代的流程。目前是通过油猴脚本解决的。希望大佬点我。 `// ==UserScript== // @name FRP Port Clickable Link // @namespace frp-port-linker // @version 1.0 // @description Make FRP TCP port numbers clickable // @match *://*/* // @grant none // ==/UserScript== (function () { 'use strict'; const TARGET_PATH = '/static/#/proxies/tcp'; function isTargetPage() { return location.pathname + location.hash === TARGET_PATH; } function makePortLinks() { if (!isTargetPage()) return; const host = location.hostname; const protocol = location.protocol; const nodes = document.querySelectorAll('td, div, span'); nodes.forEach(node => { if (node.dataset.frpLinked) return; const text = node.innerText?.trim(); if (!text) return; // 匹配端口号(放宽到 1–65535 的合理长度) if (!/^\d{1,5}$/.test(text)) return; const port = Number(text); if (port < 1 || port > 65535) return; const a = document.createElement('a'); a.href = `${protocol}//${host}:${port}/`; a.innerText = text; a.target = '_blank'; a.style.color = '#409eff'; a.style.textDecoration = 'underline'; node.innerHTML = ''; node.appendChild(a); node.dataset.frpLinked = '1'; }); } // 初次执行 makePortLinks(); // 监听 SPA DOM 变化 const observer = new MutationObserver(() => { makePortLinks(); }); observer.observe(document.body, { childList: true, subtree: true }); })(); ` ### Describe alternatives you've considered _No response_ ### Affected area - [ ] Docs - [ ] Installation - [ ] Performance and Scalability - [ ] Security - [x] User Experience - [ ] Test and Release - [ ] Developer Infrastructure - [ ] Client Plugin - [ ] Server Plugin - [ ] Extensions - [ ] Others
gitea-mirror 2026-05-05 14:33:08 -06:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 9, 2026):

Issues go stale after 14d of inactivity. Stale issues rot after an additional 3d of inactivity and eventually close.

<!-- gh-comment-id:3868729777 --> @github-actions[bot] commented on GitHub (Feb 9, 2026): Issues go stale after 14d of inactivity. Stale issues rot after an additional 3d of inactivity and eventually close.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#4019
No description provided.