add rtcp
This commit is contained in:
@ -6,6 +6,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/go-gost/gosocks5"
|
||||
"github.com/go-gost/gost/pkg/chain"
|
||||
"github.com/go-gost/gost/pkg/handler"
|
||||
"github.com/go-gost/gost/pkg/internal/bufpool"
|
||||
"github.com/go-gost/gost/pkg/internal/utils/socks"
|
||||
@ -16,6 +17,14 @@ func (h *socks5Handler) handleUDPTun(ctx context.Context, conn net.Conn, req *go
|
||||
"cmd": "udp-tun",
|
||||
})
|
||||
|
||||
if !h.md.enableUDP {
|
||||
reply := gosocks5.NewReply(gosocks5.NotAllowed, nil)
|
||||
reply.Write(conn)
|
||||
h.logger.Debug(reply)
|
||||
h.logger.Error("UDP relay is diabled")
|
||||
return
|
||||
}
|
||||
|
||||
if h.chain.IsEmpty() {
|
||||
addr := req.Addr.String()
|
||||
|
||||
@ -56,7 +65,7 @@ func (h *socks5Handler) handleUDPTun(ctx context.Context, conn net.Conn, req *go
|
||||
return
|
||||
}
|
||||
|
||||
r := (&handler.Router{}).
|
||||
r := (&chain.Router{}).
|
||||
WithChain(h.chain).
|
||||
WithRetry(h.md.retryCount).
|
||||
WithLogger(h.logger)
|
||||
|
Reference in New Issue
Block a user