【问题标题】:Ngrok inbuilt file server configuration through config fileNgrok通过config文件内置文件服务器配置
【发布时间】:2021-09-07 21:47:50
【问题描述】:

当我们在命令行中运行以下命令时,Ngrok 使用 inbuild server 为文件夹提供服务

    ngrok http file://<path to file>

我正在尝试使用配置文件在同一台机器上配置更多隧道(如 ssh)

    tunnels:
      httpbin:
        proto: http
        file: "//<path to file>" ##THIS IS ERROR ##
      demo:
        proto: ssh
        addr: 22

似乎无法使用 ngrok 中的配置文件配置内置文件共享。或者有什么办法?

【问题讨论】:

    标签: ngrok


    【解决方案1】:

    你试试这个步骤:

    1. https://dashboard.ngrok.com/get-started/your-authtoken 并登录
    2. 终端并运行:ngrok authtoken token_id 结果: Authtoken saved to configuration file: /home/user/.ngrok2/ngrok.yml
    3. 终端:ngrok http file:///home
    4. 完成!

    结果:https://i.stack.imgur.com/FPZbP.png

    ngrok 文档:https://ngrok.com/docs

    【讨论】:

      【解决方案2】:

      其实只是偶然发现的。一些实验,并不能保证它会继续工作,因为它没有在文档中提到。只需在addr yaml 选项中使用file: 协议即可。

      authtoken: <REDACTED>
      tunnels:
        dev2:
          proto: http
          addr: file:///some/path/just/like/command/line
          hostname: my-great-subdomain.ngrok.io
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2019-03-19
        • 2013-10-05
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-05-11
        相关资源
        最近更新 更多