working commit
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user