Coder Social home page Coder Social logo

vnt's Introduction

VNT

🚀An efficient VPN

🚀一个简单、高效、能快速组建虚拟局域网的工具

vnt-cli参数详解 参数说明

快速开始:

  1. 指定一个token,在多台设备上运行该程序,例如:

      # linux上
      root@DESKTOP-0BCHNIO:/opt# ./vnt-cli -k 123456
      # 在另一台linux上使用nohup后台运行
      root@izj6cemne76ykdzkataftfz vnt# nohup ./vnt-cli -k 123456 &
      # windows上
      D:\vnt\bin_v1>vnt-cli.exe -k 123456
  2. 可以执行info命令查看当前设备的虚拟ip

     root@DESKTOP-0BCHNIO:/opt# ./vnt-cli --info
     Name: Ubuntu 18.04 (bionic) [64-bit]
     Virtual ip: 10.26.0.2
     Virtual gateway: 10.26.0.1
     Virtual netmask: 255.255.255.0
     Connection status: Connected
     NAT type: Cone
     Relay server: 43.139.56.10:29871
     Public ips: 120.228.76.75
     Local ip: 172.25.165.58
  3. 也可以执行list命令查看其他设备的虚拟ip

     root@DESKTOP-0BCHNIO:/opt# ./vnt-cli --list
     Name                                                       Virtual Ip      P2P/Relay      Rt      Status
     Windows 10.0.22621 (Windows 11 Professional) [64-bit]      10.26.0.3       p2p            2       Online
     CentOS 7.9.2009 (Core) [64-bit]                            10.26.0.4       p2p            35      Online
  4. 最后可以用虚拟ip实现设备间相互访问

    ssh
  5. 帮助,使用-h命令查看

使用须知

  • token的作用是标识一个虚拟局域网,当使用公共服务器时,建议使用一个唯一值当token(比如uuid),否则有可能连接到其他人创建的虚拟局域网中
  • 默认使用公共服务器做注册和中继,目前的配置是2核4G 4Mbps,有需要再扩展~
  • vnt-cli需要使用命令行运行
  • Mac和Linux下需要加可执行权限(例如:chmod +x ./vnt-cli)
  • 可以自己搭中继服务器(server)

直接使用

下载release文件

帮助文档

自行编译

点击展开

前提条件:安装rust编译环境(install rust)

到项目根目录下执行 cargo build -p vnt-cli

也可按需编译,将得到更小的二进制文件,使用--no-default-features排除默认features

cargo build -p vnt-cli --no-default-features

features说明

feature 说明 是否默认
openssl 使用openssl中的加密算法
openssl-vendored 从源码编译openssl
ring-cipher 使用ring中的加密算法
aes_cbc 支持aes_cbc加密
aes_ecb 支持aes_ecb加密
aes_gcm 支持aes_gcm加密
sm4_cbc 支持sm4_cbc加密
chacha20_poly1305 支持chacha20和chacha20_poly1305加密
server_encrypt 支持服务端加密
ip_proxy 内置ip代理
port_mapping 端口映射
log 日志
command list、route等命令
file_config yaml配置文件
lz4 lz4压缩
zstd zstd压缩
upnp upnp协议
ws ws协议
wss wss协议

支持平台

  • Mac
  • Linux
  • Windows
    • 默认使用tun网卡 依赖wintun.dll(win-tun)(将dll放到同目录下,建议使用版本0.14.1)
    • 可选择使用tap网卡 依赖tap-windows(win-tap)(建议使用版本9.24.7)
  • Android

GUI

支持安卓和Windows 下载

特性

  • IP层数据转发
  • NAT穿透
    • 点对点穿透
    • 服务端中继转发
    • 客户端中继转发
  • IP代理(点对点、点对网)
  • p2p组播/广播
  • 客户端数据加密(aes-gcmchacha20-poly1305等多种加密算法)
  • 服务端数据加密(rsa + aes-gcm)
  • 多通道UDP应对QOS
  • 支持TCP、UDP、WebSocket等多种协议
  • 支持数据压缩

更多玩法

  1. 和远程桌面(如mstsc)搭配,超低延迟的体验
  2. 安装samba服务,共享磁盘
  3. 点对网,访问内网其他机器、IP代理(结合启动参数'-i'和'-o')

Todo

  • 桌面UI(已支持)
  • 使用FEC、ARQ等方式提升弱网环境的稳定性

常见问题

展开

问题1: 设置网络地址失败

可能原因:

vnt默认使用10.26.0.0/24网段,和本地网络适配器的ip冲突

解决方法:
  1. 方法一:找到冲突的IP,将其改成别的
  2. 方法二:自建服务器,指定其他不会冲突的网段
  3. 方法三:增加参数-d ,设置不同的id会让服务端分配不同的IP,从而绕开有冲突的IP

问题2: windows系统上wintun.dll加载失败

可能原因:

没有下载wintun.dll 或者使用的wintun.dll有问题

解决方法:
  1. 下载最新版的wintun.dll 下载链接
  2. 解压后找到对应架构的目录,通常是amd64
  3. 将对应的wintun.dll放到和vnt-cli同目录下(或者放到C盘Windows目录下)
  4. 再次启动vnt-cli

问题3: 丢包严重,或是不能正常组网通信

可能原因:

某些宽带下(比如广电宽带)UDP丢包严重

解决方法:
  1. 使用TCP模式中继转发(vnt-cli增加--tcp参数)
  2. 如果p2p后效果很差,可以选择禁用p2p(vnt-cli增加--use-channel relay 参数)

问题4:重启后虚拟IP发生变化,或指定了IP不能启动

可能原因:

设备重启后程序自动获取的id值改变,导致注册时重新分配了新的IP,或是IP冲突

解决方法:
  1. 命令行启动增加-d参数(使用配置文件启动则在配置文件中增加device_id参数),要保证每个设备的值都不一样,取值可以任意64位以内字符串

交流群

对VNT有任何问题均可以加群联系作者

QQ: 1034868233

赞助

如果VNT对你有帮助,欢迎打赏作者

其他

可使用社区小伙伴搭建的中继服务器

  1. -s vnt.8443.eu.org:29871
  2. -s vnt.wherewego.top:29872

参与贡献

vnt's People

Contributors

droid-max avatar iron-yang-go avatar jslyrd avatar taotieren avatar vnt-dev avatar ziyouwa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vnt's Issues

-W参数运行不久后报错

1.2.4 :-W参数说明里面并没有,已尝试-W和-W xxxxx方式,结果都一样。现象是执行一会儿后用vnt-cli --list会报错:
cmd: Resource temporarily unavailable (os error 11)
应该执行任何命令都会报错。

另外,在其中一台linux上用非root用户执行vnt-cli,会创建3个进程,都执行的同样的命令,sudo执行也一样,用root则不会

不指定DNS

不指定DNS, 默认用114.114.114.114, 有时运营商会干扰,用了第三方的反而会不稳。
没有指定DNS的时候,默认还是用网卡获取到的DNS吧

windows 11 , wintun启动不成功

用wintun的x86的dll

C:\Users\admin\Downloads\vnt-cli-i686-pc-windows-msvc-1.2.3.tar>vnt-cli.exe  -k kkkkktest
version 1.2.3
 ====== Connect Successfully ======
virtual_gateway:10.26.0.1
virtual_ip:10.26.0.3

然后程序就自动退出来,没有继续打印,在别的设备用--list能看到这个windows设备短暂online,然后offline

用wintun的amd64的dll,github 的release下载的是32位的吧

C:\Users\admin\Downloads\vnt-cli-i686-pc-windows-msvc-1.2.3.tar>vnt-cli.exe  -k kkkkktest
version 1.2.3
 ====== Connect Successfully ======
virtual_gateway:10.26.0.1
virtual_ip:10.26.0.3
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Custom { kind: Other, error: "wintun.dll not found LoadLibraryExW { source: Os { code: 193, kind: Uncategorized, message: \"%1 不是有效的 Win32 应用程序。\" } }" }', vnt-cli\src\main.rs:346:47
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

aarch64-apple-darwin

在今年 WWDC23 上,最后一款使用英特尔芯片的 Mac Pro 产品转变搭载 M2 Ultra 芯片,虽然比设想中的要迟了一年,但苹果依然是彻底告别了英特尔芯片时代。
只有历史版本的mac机器使用x86_64-apple-darwin架构
新机器将是aarch64-apple-darwin架构

能帮我Releases一个aarch64-apple-darwin吗

subnet

please consider to add a subnets parameter

switch-desktop.exe start --subnets 172.11.64.0/22,192.168.1.1/32

so other enabled peers can access the client subnets remote network

Service

Please consider to run the Windows binary without the need to install service.

ssh连上就断线

比如家里有openwrt路由器和unraid,都开了ssh服务。
在公司用vnt打洞回家成功后,使用xshell ssh连openwrt和unraid,连上半分钟内必定会自动断开

root@OpenWrt:~# 
root@OpenWrt:~# Connection closing...Socket close.

Connection closed by foreign host.

Disconnected from remote host(192.168.6.1) at 16:11:20.

别的隧道方式都不会出现这种情况。

如何删除已占用的ip

不知道是不是id还是程序位置移动了,导致同一个机器无法使用希望的ip。显示offline
类似
ubuntu11 10.26.0.23 Offline
ubuntu11 10.26.0.3

win10操作系统启动报错

C:\Users\Administrator\Desktop\vnt>vnt-cli.exe -k 123456
version 1.2.3
====== Connect Successfully ======
virtual_gateway:10.26.0.1
virtual_ip:10.26.0.5
thread 'main' panicked at 'called Result::unwrap() on an Err value: Custom { kind: Other, error: "Custom { kind: Other, error: "Failed to crate adapter" }" }', vnt-cli\src\main.rs:346:47
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

--list 提示 not started

进程有在

root@opmain:~# ps |grep vnt
 5352 root     11172 S    /usr/bin/vnts --port 65534 --gateway 10.26.0.1 --netmask 255.255.255.0
15302 root     16928 S    /usr/bin/vnt-cli -f /var/etc/vnt/conf.yaml
15577 root      1228 S    grep vnt
root@opmain:~# /usr/bin/vnt-cli --list
cmd: Custom { kind: Other, error: "not started" }

Cannot read YAML File Properly

Hi,

I've been tested the vnt-cli for couple days now. I realized that if I use the yaml file to configure the vnt client, the client does not read server address correctly.

Here is my yaml file:

token: $someTokenHere name: $HostnameHere password: $SomePasswordHere server: $ServerHostName:Port ip: $AssignedIPHere mtu: 1250 parallel: 16 no-proxy: true first-latency: true

When I use the yaml file above, the vnt-cli will give me invalid ip error. Once I removed the server, I will get successful message like
version 1.2.8 ====== Connect Successfully ====== virtual_gateway:10.26.0.1 virtual_ip:10.26.0.2 ====== Create Network Interface Successfully ====== name:vnt-tun version: ====== Start Successfully ======
However, the server I run does not on the 10.26.0.1/24 virtual ip CIDR.

If I run the client by using command arguments, it works correctly.

Here is the result with command line:
version 1.2.8 ====== Connect Successfully ====== virtual_gateway:100.x.x.x virtual_ip:100.x.x.x ====== Create Network Interface Successfully ====== name:vnt-tun version: ====== Start Successfully ======

vns 客户端使用vnts域名连接时,报DNS query failed

客户端版本:v1.2.9 包:vnt-cli-aarch64-unknown-linux-musl-v1.2.9.tar.gz

在使用vnt-cli命令连接vnt服务端(服务端使用域名),无法解析出域名,但在客户端上运行nslookup是可以正常解析出域名地址的,另连服务端IP地址没有问题。

在只读文件系统上提示错误,但是使用其他类似软件可以临时创建一个虚拟网卡,vnt则不行

1、直接执行
root@imx8mqevk:/opt/ycx-bak/vnt# ./vnt-cli -k 123456
thread 'main' panicked at vnt-cli/src/config/mod.rs:170:42:
called Result::unwrap() on an Err value: Os { code: 30, kind: ReadOnlyFilesystem, message: "Read-only file system" }
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
Aborted
2、增加-d参数
root@imx8mqevk:/opt/ycx-bak/vnt# ./vnt-cli -k 123456 -d test
version 1.2.8
====== Connect Successfully ======
virtual_gateway:10.26.0.1
virtual_ip:10.26.0.12
====== Create Network Interface Successfully ======
name:vnt-tun
version:
====== Start Successfully ======
command error :Read-only file system (os error 30)

使用ws协议无法连接上自建服务器

自建的 vnts服务器版本 1.2.11 阿里云服务器

客户端最新版本 1.2.11 openwrt里

使用tcp://服务器地址 可以链接
5V 7DJLII4OY5W$Y7Z_AGRX
使用ws://服务器地址无法连接
8`F5H)U2EIH%9NY%L_@{ B

服务器日志的如下
`2024-07-02T01:50:03.060825799+02:00 [src/main.rs:256] INFO vnts:config:ConfigInfo { port: 1095, white_token: None, gateway: 10.26.0.1, broadcast: 10.26.0.255, netmask: 255.255.255.0, check_finger: false, username: "admin", password: "admin" }
2024-07-02T01:50:03.061079201+02:00 [src/main.rs:258] INFO vnts:监听udp端口: 1095
2024-07-02T01:50:03.061142224+02:00 [src/main.rs:261] INFO vnts:监听tcp/ws端口: 1095
2024-07-02T01:55:21.068422125+02:00 [src/main.rs:256] INFO vnts:config:ConfigInfo { port: 1095, white_token: None, gateway: 10.26.0.1, broadcast: 10.26.0.255, netmask: 255.255.255.0, check_finger: false, username: "admin", password: "admin" }
2024-07-02T01:55:21.068628993+02:00 [src/main.rs:258] INFO vnts:监听udp端口: 1095
2024-07-02T01:55:21.068672942+02:00 [src/main.rs:261] INFO vnts:监听tcp/ws端口: 1095
2024-07-02T07:17:51.309804775+02:00 [src/core/server/websocket/mod.rs:18] WARN vnts::core::server::websocket:websocket err Error during WebSocket handshake [::ffff:188.119.66.112]:63651

Caused by:
0: WebSocket protocol error: httparse error: invalid token
1: httparse error: invalid token
2: invalid token [::ffff:188.119.66.112]:63651
2024-07-02T12:50:41.885148128+02:00 [src/core/server/tcp.rs:32] WARN vnts::core::server::tcp:数据流读取失败 [::ffff:112.96.50.174]:3174
2024-07-02T12:51:25.722171395+02:00 [src/core/server/tcp.rs:32] WARN vnts::core::server::tcp:数据流读取失败 [::ffff:112.96.50.174]:37906
2024-07-02T12:53:46.481462929+02:00 [src/core/server/tcp.rs:32] WARN vnts::core::server::tcp:数据流读取失败 [::ffff:112.96.50.174]:37907
2024-07-03T05:05:35.033059392+02:00 [src/core/server/websocket/mod.rs:18] WARN vnts::core::server::websocket:websocket err Error during WebSocket handshake [::ffff:42.240.145.70]:17362

Caused by:
0: WebSocket protocol error: No "Connection: upgrade" header
1: No "Connection: upgrade" header [::ffff:42.240.145.70]:17362
2024-07-03T05:05:35.564224862+02:00 [src/core/server/websocket/mod.rs:18] WARN vnts::core::server::websocket:websocket err Error during WebSocket handshake [::ffff:42.240.145.70]:17372

Caused by:
0: WebSocket protocol error: httparse error: invalid token
1: httparse error: invalid token
2: invalid token [::ffff:42.240.145.70]:17372
2024-07-03T05:05:39.088561009+02:00 [src/core/server/tcp.rs:32] WARN vnts::core::server::tcp:数据流读取失败 [::ffff:42.240.145.70]:17378
2024-07-03T05:05:39.360331866+02:00 [src/core/server/websocket/mod.rs:18] WARN vnts::core::server::websocket:websocket err Error during WebSocket handshake [::ffff:42.240.145.70]:17416

Caused by:
0: WebSocket protocol error: HTTP version must be 1.1 or higher
1: HTTP version must be 1.1 or higher [::ffff:42.240.145.70]:17416
2024-07-03T05:05:39.889503726+02:00 [src/core/server/websocket/mod.rs:18] WARN vnts::core::server::websocket:websocket err Error during WebSocket handshake [::ffff:42.240.145.70]:17420

Caused by:
0: WebSocket protocol error: httparse error: invalid token
1: httparse error: invalid token
2: invalid token [::ffff:42.240.145.70]:17420
2024-07-03T05:05:40.423376189+02:00 [src/core/server/websocket/mod.rs:18] WARN vnts::core::server::websocket:websocket err Error during WebSocket handshake [::ffff:42.240.145.70]:17422

Caused by:
0: WebSocket protocol error: httparse error: invalid token
1: httparse error: invalid token
2: invalid token [::ffff:42.240.145.70]:17422
2024-07-03T05:05:40.947300031+02:00 [src/core/server/websocket/mod.rs:18] WARN vnts::core::server::websocket:websocket err Error during WebSocket handshake [::ffff:42.240.145.70]:17438

Caused by:
0: WebSocket protocol error: httparse error: invalid token
1: httparse error: invalid token
2: invalid token [::ffff:42.240.145.70]:17438
2024-07-03T05:05:41.499296575+02:00 [src/core/server/websocket/mod.rs:18] WARN vnts::core::server::websocket:websocket err Error during WebSocket handshake [::ffff:42.240.145.70]:17444

Caused by:
0: WebSocket protocol error: httparse error: invalid token
1: httparse error: invalid token
2: invalid token [::ffff:42.240.145.70]:17444
2024-07-03T05:05:42.021716424+02:00 [src/core/server/websocket/mod.rs:18] WARN vnts::core::server::websocket:websocket err Error during WebSocket handshake [::ffff:42.240.145.70]:17458

Caused by:
0: WebSocket protocol error: httparse error: invalid token
1: httparse error: invalid token
2: invalid token [::ffff:42.240.145.70]:17458
`

后台运行 会导致segment fault

nohup ./vnt-cli xxxx & 会导致segment fault

具体是,执行几分钟之后,就会崩溃,ps -ef 显示segment fault.
环境是ubuntu 20.04
前台运行不会崩溃。

非正常断开连接会提示IP已存在?

# vnt-cli -f  /var/etc/vnt/conf.yaml
version 1.2.7
ip already exists

token: xxxxxxx
name: home
in_ips:
  - 192.168.10.0/24,10.26.0.231
out_ips:
  - 192.168.222.0/24
password: xxxxxx
ip: 10.26.0.230
punch_model: ipv4

Alpine Linux 3.20经常stop, 如何查找问题

Alpine Linux 3.20 下不管nohup还是使用openrc,一段时间后都会stop。 另外一个ubuntu22没出现

version 1.2.9
Serial:240
exe cmd: ifconfig vnt-tun txqueuelen 1000
create_tun name=vnt-tun ,version=
connect count=1 ,address=8.134.146.7:29872
handshake no_secret server version=1.2.9
register ip=10.26.0.23 ,netmask=255.255.255.0 ,gateway=10.26.0.1
exe cmd: ip route add 10.26.0.0/255.255.255.0 dev vnt-tun
exe cmd: ip route add 255.255.255.255/255.255.255.255 dev vnt-tun
exe cmd: ip route add 224.0.0.0/240.0.0.0 dev vnt-tun
 ====== Connect Successfully ====== 
stopped
#!/sbin/openrc-run
#supervisor=supervise-daemon
name="vnt"
command="vnt-cli"
command_args="-k xxx -n xxx --ip 10.26.0.23"
command_background=true
pidfile="/run/${name}.pid"

Edge agent support

Some devices cannot run third-party programs. But I can add a server next to it as a proxy server. And want to support one to many. Or it can be configured in the router.

自定义虚拟IP出错

虚拟IP只能是10.26.0.1/24,除了这个网段的IP都无法配置,报错:error ErrorType=InvalidIp

win10是否可以运行

win10是否可以运行?看着帮助没玩起来,能不能出个简单的操作流程

在win10/win11 下均出现类似问题

直接下载的1.2.9版本的vnt-cli ,同目录下有 wintun.dll (win10 / win11 环境都试了的)
在以

vnt-cli -k <token>

运行后,先是获取了正常的结果

version 1.2.9
Serial:2405110136-349

但接着用如下命令时:

vnt-cli --info

获取了如下信息:

cmd: 0s {code: 10054,kind: ConnectionReset, message:"远程主机强迫关闭了一个现有的连接。"}

Server端考虑开源吗?

会Server端开源或者提供Server端执行程序吗?这样就可以搭建自己的服务而不是使用公共服务

Proxy support

please consider adding
http (connect) proxy and socks5 proxy support
to be able to connect to switchserver when you are behind one of these

新增功能请求

vnt-cli客户端能否增加一个--json的参数,这样可以方便其他程序调用返回参数。

linux run with error

➜ sudo RUST_BACKTRACE=1 /tmp/switch/target/debug/switch-desktop  --token xxx
starting...
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Io(Os { code: 19, kind: Uncategorized, message: "No such device" })', switch/src/tun_device/linux.rs:31:40
stack backtrace:
   0: rust_begin_unwind
             at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:575:5
   1: core::panicking::panic_fmt
             at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/core/src/panicking.rs:64:14
   2: core::result::unwrap_failed
             at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/core/src/result.rs:1791:5
   3: core::result::Result<T,E>::unwrap
             at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/core/src/result.rs:1113:23
   4: switch::tun_device::linux::create_tun
             at ./switch/src/tun_device/linux.rs:31:19
   5: switch::Switch::start_::{{closure}}
             at ./switch/src/lib.rs:145:13
   6: tokio::runtime::park::CachedParkThread::block_on::{{closure}}
             at /home/zhijia/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.25.0/src/runtime/park.rs:283:63
   7: tokio::runtime::coop::with_budget
             at /home/zhijia/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.25.0/src/runtime/coop.rs:102:5
   8: tokio::runtime::coop::budget
             at /home/zhijia/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.25.0/src/runtime/coop.rs:68:5
   9: tokio::runtime::park::CachedParkThread::block_on
             at /home/zhijia/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.25.0/src/runtime/park.rs:283:31
  10: tokio::runtime::context::BlockingRegionGuard::block_on
             at /home/zhijia/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.25.0/src/runtime/context.rs:315:13
  11: tokio::runtime::scheduler::multi_thread::MultiThread::block_on
             at /home/zhijia/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.25.0/src/runtime/scheduler/multi_thread/mod.rs:66:9
  12: tokio::runtime::runtime::Runtime::block_on
             at /home/zhijia/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.25.0/src/runtime/runtime.rs:284:45
  13: switch::Switch::start
             at ./switch/src/lib.rs:48:22
  14: switch_desktop::main
             at ./switch-desktop/src/main.rs:78:18
  15: core::ops::function::FnOnce::call_once
             at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/core/src/ops/function.rs:507:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

vnt-cli输出日志

将log4rs.yaml文件放到vnt-cli同目录下,到该目录启动vnt-cli,将会有输出日志到./log目录中。log4rs.yaml可以参考:

# cat log4rs.yaml
refresh_rate: 30 seconds
appenders:
  rolling_file:
    kind: rolling_file
    path: log/vnt-cli.log
    append: true
    encoder:
      pattern: "{d} [{f}:{L}] {h({l})} {M}:{m}{n}"
    policy:
      kind: compound
      trigger:
        kind: size
        limit: 5 mb
      roller:
        kind: fixed_window
        pattern: log/vnt-cli.{}.log
        base: 1
        count: 5

root:
  level: info
  appenders:
    - rolling_file

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.