V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
yaron
V2EX  ›  Linux

请教大佬一个关于 frp 的问题

  •  
  •   yaron · 2022-03-30 16:53:49 +08:00 · 2454 次点击
    这是一个创建于 729 天前的主题,其中的信息可能已经有所发展或是发生改变。

    有两台 frpc ,能绑定同一个服务的远程端口吗?

    A 机 frpc.ini:

    [common]
    ...
    [A]  
    type = tcp
    local_ip = 127.0.0.1
    local_port = 22
    remote_port = 6000
    subdomain = A
    

    B 机 frpc.ini:

    [common]
    ...
    [B]  
    type = tcp
    local_ip = 127.0.0.1
    local_port = 22
    remote_port = 6000
    subdomain = B
    

    A\B 机common部分一样,想问要修改哪些配置才能绑定同一个remote_port?

    7 条回复    2022-03-30 22:42:47 +08:00
    rc1
        1
    rc1  
       2022-03-30 17:01:04 +08:00   ❤️ 1
    remote_port 服务器的端口,不能用一样的
    你这两个配置,是访问服务器的 6000 端口,映射到 A 机的 22 ,和 B 机的 22 端口
    B 机应该改为 remote_port = 6001 ,即访问服务器的 6001 端口,映射到 B 机的 22 端口
    brader
        2
    brader  
       2022-03-30 17:05:22 +08:00
    端口号那么多,为什么一定要 同一个,有什么特殊要求
    Kasumi20
        3
    Kasumi20  
       2022-03-30 17:06:07 +08:00   ❤️ 1
    肯定不行啊,又不是 HTTP ,可以根据域名知道访问的目标是谁
    yaott2020
        4
    yaott2020  
       2022-03-30 17:07:38 +08:00 via Android   ❤️ 1
    frp 暂不支持 tcp 复用,除非是 http 的 tcp 连接。详情看文档: http://gofrp.org
    yaron
        5
    yaron  
    OP
       2022-03-30 17:12:51 +08:00
    结案: http 可以通过二级域名实现同一个端口多个客户端,tcp 不行。
    参考: https://gofrp.org/docs/features/http-https/subdomain/
    kingfalse
        6
    kingfalse  
       2022-03-30 18:37:18 +08:00 via Android
    歪个楼,自用的话还是转 tailscale 吧,简单省事
    doubtlhy
        7
    doubtlhy  
       2022-03-30 22:42:47 +08:00 via iPhone
    @kingfalse 我的 tailscale ios 客户端打开一直是 loading 状态,用不了。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1136 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 18:34 · PVG 02:34 · LAX 11:34 · JFK 14:34
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.