mirror of
https://github.com/yhl452493373/frpc-panel.git
synced 2026-04-04 06:17:00 +08:00
support show proxy config of frpc 0.53
This commit is contained in:
@@ -5,7 +5,6 @@ import (
|
||||
"fmt"
|
||||
"github.com/fatedier/frp/pkg/config"
|
||||
v1 "github.com/fatedier/frp/pkg/config/v1"
|
||||
"github.com/pelletier/go-toml/v2"
|
||||
"github.com/vaughan0/go-ini"
|
||||
"io"
|
||||
"log"
|
||||
@@ -155,51 +154,11 @@ func (c *HandleController) parseConfigure(content, proxyType string) (interface{
|
||||
}
|
||||
|
||||
allProxies := clientConfig.Proxies
|
||||
var filterProxies = make([]MyProxy, 0)
|
||||
var filterProxies = make([]v1.TypedProxyConfig, 0)
|
||||
for i := range allProxies {
|
||||
if equalIgnoreCase(allProxies[i].Type, proxyType) {
|
||||
baseConfig := allProxies[i].GetBaseConfig()
|
||||
marshal, _ := toml.Marshal(allProxies[i].ProxyConfigurer)
|
||||
proxy := MyProxy{
|
||||
string(marshal),
|
||||
baseConfig,
|
||||
}
|
||||
filterProxies = append(filterProxies, proxy)
|
||||
filterProxies = append(filterProxies, allProxies[i])
|
||||
}
|
||||
}
|
||||
|
||||
var ss = `
|
||||
Name = 'ssh_random'
|
||||
Type = 'tcp'
|
||||
LocalIP = '192.168.31.100'
|
||||
LocalPort = 22
|
||||
RemotePort = 0
|
||||
|
||||
[Transport]
|
||||
UseEncryption = false
|
||||
UseCompression = false
|
||||
BandwidthLimitMode = ''
|
||||
ProxyProtocolVersion = ''
|
||||
|
||||
[Transport.BandwidthLimit]
|
||||
|
||||
[LoadBalancer]
|
||||
Group = ''
|
||||
GroupKey = ''
|
||||
|
||||
[HealthCheck]
|
||||
Type = ''
|
||||
TimeoutSeconds = 0
|
||||
MaxFailed = 0
|
||||
IntervalSeconds = 0
|
||||
Path = ''
|
||||
|
||||
[Plugin]
|
||||
Type = ''
|
||||
|
||||
`
|
||||
v := v1.ProxyType("tcp")
|
||||
r := v1.NewProxyConfigurerByType(v)
|
||||
toml.Unmarshal([]byte(ss), r)
|
||||
return filterProxies, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user