frp报错 while decoding JSON: json: cannot unmarshal string into Go value of type

07-03 1377阅读

之前在研究frp如何使用时报错

error unmarshaling JSON: while decoding JSON: json: cannot unmarshal string into Go value of type v1.ServerConfig

不知道为什么,查了半天才知道原因,原来是因为frp0.53.2版本中配置文件是按照json格式编写的,如果是字符串格式的值是需要加双引号的,否则会报错。

比如:frps.toml配置文件中

vhostHTTPPort = 8080

bind_addr = “XXX.XXX.XXX.XXX”

bindPort = 7000

webServer.addr = “127.0.0.1”

webServer.port = 7500

webServer.user = “admin”

webServer.password = “admin”

log.to = “./frps.log”

log.level = “info”

log.maxDays = 3

bind_addr这种ip地址就是字符串,是必须加双引号的,如果不加,在启动frps时就会报错误,如下图。

frp报错 while decoding JSON: json: cannot unmarshal string into Go value of type

将ip地址加上双引号后,再执行就可以正常启动了。

frp报错 while decoding JSON: json: cannot unmarshal string into Go value of type

VPS购买请点击我

文章版权声明:除非注明,否则均为主机测评原创文章,转载或复制请以超链接形式并注明出处。

目录[+]