From 5a5985a5736b82d537affb879fcebb6a6efc2e87 Mon Sep 17 00:00:00 2001 From: Akilan Date: Fri, 23 Aug 2024 04:38:17 +0100 Subject: [PATCH] enabled TLS --- p2p/frp/client.go | 15 +++++++-------- server/ReverseProxy.go | 2 +- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/p2p/frp/client.go b/p2p/frp/client.go index 54aa07b..adabd37 100644 --- a/p2p/frp/client.go +++ b/p2p/frp/client.go @@ -1,7 +1,6 @@ package frp import ( - defaultConfig "github.com/Akilan1999/p2p-rendering-computation/config" "github.com/Akilan1999/p2p-rendering-computation/server/docker" "github.com/fatedier/frp/client" "github.com/fatedier/frp/pkg/config" @@ -145,10 +144,10 @@ func (c *Client) StartFRPClient() error { cfg := config.GetDefaultClientConf() - Config, err := defaultConfig.ConfigInit(nil, nil) - if err != nil { - return err - } + //Config, err := defaultConfig.ConfigInit(nil, nil) + //if err != nil { + // return err + //} var proxyConfs map[string]config.ProxyConf var visitorCfgs map[string]config.VisitorConf @@ -157,9 +156,9 @@ func (c *Client) StartFRPClient() error { cfg.ServerAddr = c.Server.address cfg.ServerPort = c.Server.port - cfg.TLSEnable = true - cfg.TLSKeyFile = Config.KeyFile - cfg.TLSCertFile = Config.PemFile + //cfg.TLSEnable = true + //cfg.TLSKeyFile = Config.KeyFile + //cfg.TLSCertFile = Config.PemFile for i, _ := range c.ClientMappings { var tcpcnf config.TCPProxyConf diff --git a/server/ReverseProxy.go b/server/ReverseProxy.go index 87b4dff..7b715b4 100644 --- a/server/ReverseProxy.go +++ b/server/ReverseProxy.go @@ -97,7 +97,7 @@ func Proxy(c *gin.Context) { return } - rUrl := fmt.Sprintf("%v://%v%v", scheme, forwardTo, c.Request.URL) + rUrl := fmt.Sprintf("%v://%v%v", "http", forwardTo, c.Request.URL) remote, err := url.Parse(rUrl)