dev tunnel由微软开发,实现本地公网访问本地http的功能。

下载:
https://vip.123pan.cn/1815238395/download/devtunnel/linux-x64-devtunnel
https://vip.123pan.cn/1815238395/download/devtunnel/devtunnel.exe
https://vip.123pan.cn/1815238395/download/devtunnel/osx-x64-devtunnel-zip.zip
https://vip.123pan.cn/1815238395/download/devtunnel/osx-arm64-devtunnel-zip.zip

简单使用

  • 登录
    通过在本地使用 ./linux-x64-devtunnel login 会打开浏览器并使用微软账号登录

    jacky@jacky-office:~/Downloads$ ./linux-x64-devtunnel list
    Login required.
    jacky@jacky-office:~/Downloads$ ./linux-x64-devtunnel login
    Logged in as zzlyzq@126.com using Microsoft.
    
  • 创建一条隧道
jacky@jacky-office:~/Downloads$ ./linux-x64-devtunnel create 
Tunnel ID             : silent-book-spcvmwt.asse
Name                  : 
Description           : 
Labels                : 
Access control        : {}
Host connections      : 0
Client connections    : 0
Current upload rate   : 0 MB/s (limit: 20 MB/s)
Current download rate : 0 MB/s (limit: 20 MB/s)
Tunnel Expiration     : 30 days

模拟本地http服务

jacky@jacky-office:~/Downloads$ python -m SimpleHTTPServer  
Serving HTTP on 0.0.0.0 port 8000 ...
127.0.0.1 - - [11/Dec/2023 09:59:28] code 404, message File not found
127.0.0.1 - - [11/Dec/2023 09:59:28] "GET /favicon.ico HTTP/1.1" 404 -
127.0.0.1 - - [11/Dec/2023 09:59:36] "GET / HTTP/1.1" 200 -

映射本地8000端口

jacky@jacky-office:~/Downloads$ ./linux-x64-devtunnel host -p 8000
Hosting port: 8000
Connect via browser: https://fk0tws58.asse.devtunnels.ms:8000, https://fk0tws58-8000.asse.devtunnels.ms
Inspect network activity: https://fk0tws58-8000-inspect.asse.devtunnels.ms

Ready to accept connections for tunnel: sneaky-pond-817wcjq

使用浏览器测试
发下仍需要使用微软账号登录
2023-12-11T02:08:30.png
2023-12-11T02:08:35.png

参考:https://51.ruyo.net/18563.html

最后修改:2024 年 05 月 11 日
如果觉得我的文章对你有用,请随意赞赏