working commit

This commit is contained in:
2026-05-30 13:37:43 +02:00
parent 89db87e7fa
commit cb69ca11aa
5 changed files with 21 additions and 1 deletions
+7
View File
@@ -7,6 +7,7 @@ import (
"io"
"net"
"net/http"
"strings"
"sync"
"mproxy/app/router"
@@ -16,6 +17,12 @@ func (hand *Handler) ConnectTo(rctx *router.Context) {
hostaddr := rctx.GetHost()
hand.logg.Debugf("Hostaddr: [%s]", hostaddr)
if strings.Contains(hostaddr, "https://") {
hand.logg.Errorf("Wrong request, found schema definition in Host")
rctx.SetStatus(http.StatusBadRequest)
return
}
destConn, err := net.Dial("tcp", hostaddr)
if err != nil {
hand.logg.Errorf("ConnectTo error: %v", err)