[GH-ISSUE #4754] virtual_net: error unmarshaling JSON: while decoding JSON #3756

Closed
opened 2026-05-05 14:24:21 -06:00 by gitea-mirror · 2 comments
Owner

Originally created by @synclab-srl on GitHub (Apr 16, 2025).
Original GitHub issue: https://github.com/fatedier/frp/issues/4754

Bug Description

Hi @fatedier

I'm trying the new VirtualNet feature
The client starts correctly and the utun interface is created:

Client config:

serverAddr = "myserver.net"

serverPort = 7835

auth.method = "token"
auth.token = "ababababa"

transport.protocol = "tcp"
transport.tls.enable = false

featureGates = { VirtualNet = true }
virtualNet.address = "100.86.0.1/24"

[[proxies]]
name = "virtual-net"
type = "stcp"
secretKey = "zzzzzzzzzz"
localIP = "10.10.22.69"
allowUsers = ["*"]
transport.useEncryption = true
transport.useCompression = true
[proxies.plugin]
type = "virtual_net"

Frpc log:

2025-04-16 16:21:25.443 [I] [sub/root.go:149] start frpc service for config file [/proxy.toml]
2025-04-16 16:21:25.452 [I] [client/service.go:314] try to connect to server...
2025-04-16 16:21:25.456 [I] [client/service.go:184] virtual network controller start...
2025-04-16 16:21:25.511 [I] [client/service.go:306] [45e0283e1dca94de] login to server success, get run id [45e0283e1dca94de]
2025-04-16 16:21:25.511 [I] [proxy/proxy_manager.go:177] [45e0283e1dca94de] proxy added: [virtual-net]
2025-04-16 16:21:25.532 [I] [client/control.go:172] [45e0283e1dca94de] [virtual-net] start proxy success

ifconfig log:

utun: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST>  mtu 1420
        inet 100.86.0.1  netmask 255.255.255.0  destination 100.86.0.1
        inet6 fe80::7566:9d06:bc1b:c56  prefixlen 64  scopeid 0x20<link>
        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 500  (UNSPEC)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 6  bytes 288 (288.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

When I start visitors on another machine I get the following error:

sudo ./frpc -c proxy.toml 
[sudo] password di fabio:       
error unmarshaling JSON: while decoding JSON: json: cannot unmarshal string into Go value of type v1.ClientConfig

This is the visitors configuration:

serverAddr = "myserver.net"

serverPort = 7835

auth.method = "token"
auth.token = "ababababa"

transport.protocol = "tcp"
transport.tls.enable = false

featureGates = {
  VirtualNet = true
}

virtualNet.address = "100.86.0.2/24"

[[visitors]]
name = "vnet-visitor"
type = "stcp"
serverName = "virtual-net"
secretKey = "zzzzzzzzzz"
bindPort = -1
[visitors.plugin]
type = "virtual_net"
destinationIP = "100.86.0.1"

Is there something wrong with my visitors configuration or is it a bug?

Hi and thanks

frpc Version

0.62.0

frps Version

0.62.0

System Architecture

linux/amd64

Configurations

serverAddr = "myserver.net"

serverPort = 7835

auth.method = "token"
auth.token = "ababababa"

transport.protocol = "tcp"
transport.tls.enable = false

featureGates = {
VirtualNet = true
}

virtualNet.address = "100.86.0.2/24"

visitors
name = "vnet-visitor"
type = "stcp"
serverName = "virtual-net"
secretKey = "zzzzzzzzzz"
bindPort = -1
[visitors.plugin]
type = "virtual_net"
destinationIP = "100.86.0.1"

Logs

sudo ./frpc -c proxy.toml
[sudo] password di fabio:
error unmarshaling JSON: while decoding JSON: json: cannot unmarshal string into Go value of type v1.ClientConfig

Steps to reproduce

...

Affected area

  • Docs
  • Installation
  • Performance and Scalability
  • Security
  • User Experience
  • Test and Release
  • Developer Infrastructure
  • Client Plugin
  • Server Plugin
  • Extensions
  • Others
Originally created by @synclab-srl on GitHub (Apr 16, 2025). Original GitHub issue: https://github.com/fatedier/frp/issues/4754 ### Bug Description Hi @fatedier I'm trying the new VirtualNet feature The client starts correctly and the utun interface is created: Client config: ``` serverAddr = "myserver.net" serverPort = 7835 auth.method = "token" auth.token = "ababababa" transport.protocol = "tcp" transport.tls.enable = false featureGates = { VirtualNet = true } virtualNet.address = "100.86.0.1/24" [[proxies]] name = "virtual-net" type = "stcp" secretKey = "zzzzzzzzzz" localIP = "10.10.22.69" allowUsers = ["*"] transport.useEncryption = true transport.useCompression = true [proxies.plugin] type = "virtual_net" ``` Frpc log: ``` 2025-04-16 16:21:25.443 [I] [sub/root.go:149] start frpc service for config file [/proxy.toml] 2025-04-16 16:21:25.452 [I] [client/service.go:314] try to connect to server... 2025-04-16 16:21:25.456 [I] [client/service.go:184] virtual network controller start... 2025-04-16 16:21:25.511 [I] [client/service.go:306] [45e0283e1dca94de] login to server success, get run id [45e0283e1dca94de] 2025-04-16 16:21:25.511 [I] [proxy/proxy_manager.go:177] [45e0283e1dca94de] proxy added: [virtual-net] 2025-04-16 16:21:25.532 [I] [client/control.go:172] [45e0283e1dca94de] [virtual-net] start proxy success ``` ifconfig log: ``` utun: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1420 inet 100.86.0.1 netmask 255.255.255.0 destination 100.86.0.1 inet6 fe80::7566:9d06:bc1b:c56 prefixlen 64 scopeid 0x20<link> unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 500 (UNSPEC) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 6 bytes 288 (288.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 ``` When I start visitors on another machine I get the following **error**: ``` sudo ./frpc -c proxy.toml [sudo] password di fabio: error unmarshaling JSON: while decoding JSON: json: cannot unmarshal string into Go value of type v1.ClientConfig ``` This is the visitors configuration: ``` serverAddr = "myserver.net" serverPort = 7835 auth.method = "token" auth.token = "ababababa" transport.protocol = "tcp" transport.tls.enable = false featureGates = { VirtualNet = true } virtualNet.address = "100.86.0.2/24" [[visitors]] name = "vnet-visitor" type = "stcp" serverName = "virtual-net" secretKey = "zzzzzzzzzz" bindPort = -1 [visitors.plugin] type = "virtual_net" destinationIP = "100.86.0.1" ``` Is there something wrong with my visitors configuration or is it a bug? Hi and thanks ### frpc Version 0.62.0 ### frps Version 0.62.0 ### System Architecture linux/amd64 ### Configurations serverAddr = "myserver.net" serverPort = 7835 auth.method = "token" auth.token = "ababababa" transport.protocol = "tcp" transport.tls.enable = false featureGates = { VirtualNet = true } virtualNet.address = "100.86.0.2/24" [[visitors]] name = "vnet-visitor" type = "stcp" serverName = "virtual-net" secretKey = "zzzzzzzzzz" bindPort = -1 [visitors.plugin] type = "virtual_net" destinationIP = "100.86.0.1" ### Logs sudo ./frpc -c proxy.toml [sudo] password di fabio: error unmarshaling JSON: while decoding JSON: json: cannot unmarshal string into Go value of type v1.ClientConfig ### Steps to reproduce 1. 2. 3. ... ### Affected area - [ ] Docs - [ ] Installation - [ ] Performance and Scalability - [ ] Security - [ ] User Experience - [x] Test and Release - [ ] Developer Infrastructure - [x] Client Plugin - [x] Server Plugin - [ ] Extensions - [x] Others
Author
Owner

@fatedier commented on GitHub (Apr 16, 2025):

featureGates = {
  VirtualNet = true
}

It looks like this should be changed to featureGates = { VirtualNet = true }

I need to update the documentation.

<!-- gh-comment-id:2810242445 --> @fatedier commented on GitHub (Apr 16, 2025): ``` featureGates = { VirtualNet = true } ``` It looks like this should be changed to `featureGates = { VirtualNet = true }` I need to update the documentation.
Author
Owner

@synclab-srl commented on GitHub (Apr 16, 2025):

Thanks!!!

<!-- gh-comment-id:2810909007 --> @synclab-srl commented on GitHub (Apr 16, 2025): Thanks!!!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#3756
No description provided.