working commit

This commit is contained in:
2026-05-26 17:11:13 +02:00
commit 2e59f88d76
103 changed files with 18276 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
/*
* Copyright 2026 Oleg Borodin <onborodin@gmail.com>
*/
package handler
import (
"net/http"
"mproxy/app/proxoper"
"mproxy/app/router"
)
func (hand *Handler) ConnectTo(rctx *router.Context) {
hostaddr, _ := rctx.GetSubpath("hostaddr")
params := &proxoper.ConnectToParams{
Hostaddr: hostaddr,
}
ctx := rctx.GetContext()
_, err := hand.prop.ConnectTo(ctx, params)
if err != nil {
hand.logg.Errorf("ConnectTo error: %v", err)
rctx.SetStatus(http.StatusInternalServerError)
return
}
rctx.SetStatus(http.StatusOK)
return
}