dashboard/utils/proxyhook.go
2023-09-10 17:51:17 +01:00

14 lines
413 B
Go

package utils
import (
"github.com/TicketsBot/GoPanel/config"
"net/http"
)
// Twilight's HTTP proxy doesn't support the typical HTTP proxy protocol - instead you send the request directly
// to the proxy's host in the URL. This is not how Go's proxy function should be used, but it works :)
func ProxyHook(token string, req *http.Request) {
req.URL.Scheme = "http"
req.URL.Host = config.Conf.Bot.ProxyUrl
}