V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
nomytwins
V2EX  ›  分享发现

杭州联通宽带内网转发 cloudflare 的隧道实现 web 访问的经历

  •  
  •   nomytwins · 221 天前 · 982 次点击
    这是一个创建于 221 天前的主题,其中的信息可能已经有所发展或是发生改变。

    电信转了联通发现上行提到了 100M 以上,尝试将内外的 web 服务转发到公网。 经过筛选发现 cloudflare 的 tunnel 服务可以实现端口转发到公网,但是需要在 openwrt 或者 centos 、win 上面安装相关的插件,实现数据转发。 方案一、首先尝试了 openwrt 的 web 服务端口转发,在 op 上安装了相关的软件安装失败 方案二、在 openwrt 尝试通过 docker 安装 centos 、ubuntu 系统实现 web 服务搭建和转发插件搭建,无法安装转发插件失败 方案三、在内外单独一台主机的方案还在尝试,未完待续

    12 条回复    2023-10-12 16:22:28 +08:00
    totoro625
        1
    totoro625  
       221 天前
    docker run --name tunnel --restart="unless-stopped" -d cloudflare/cloudflared:latest tunnel --protocol http2 --no-autoupdate run --token xxx

    token 获取: https://one.dash.cloudflare.com/
    建议放在软路由下面,穿透速度的好坏完全依赖你的翻墙速度
    nomytwins
        2
    nomytwins  
    OP
       221 天前
    @totoro625 不能直通吗?我用 openclash 按说不需要翻就能直通
    nomytwins
        3
    nomytwins  
    OP
       221 天前
    @totoro625 openwrt 上面的 docker 无限重启
    nomytwins
        4
    nomytwins  
    OP
       221 天前
    更新成功:
    docker 下拉取 cloudflare/cloudflared:latest
    启动方式一、执行命令 docker run --name tunnel --restart="unless-stopped" -d cloudflare/cloudflared:latest tunnel --protocol http2 --no-autoupdate run --token xxx
    启动方式二、增加容器复制命令即可
    nomytwins
        5
    nomytwins  
    OP
       220 天前
    docker 的命令行里面填入的是 tunnel run --token xxxxx 不要写其他
    goodryb
        6
    goodryb  
       220 天前
    杭州联通我记得是给公网 IP 的,直接端口转发出去
    nomytwins
        7
    nomytwins  
    OP
       220 天前
    @goodryb 给公网 ip ,但是不如独立域名 443 80 香啊
    PXW139
        8
    PXW139  
       218 天前
    如果只是图一个 80/443 端口访问,要不试试 iframe 套娃访问,访问速度比套 cf 快多了
    nomytwins
        9
    nomytwins  
    OP
       218 天前
    @PXW139 那在外部不得部署个 web 服务,这个内网开机就能一直用
    PXW139
        10
    PXW139  
       218 天前
    @nomytwins Cloudflare Pages
    nomytwins
        11
    nomytwins  
    OP
       218 天前
    @PXW139 frame 会把自己的 ip 暴露吧
    PXW139
        12
    PXW139  
       218 天前
    @nomytwins 那就没办法咯,安全与方便不可兼得,做好安全防护,家宽谁没事做来打你 XD
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1996 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 16:19 · PVG 00:19 · LAX 09:19 · JFK 12:19
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.