add bind for relay

This commit is contained in:
ginuerzh
2021-11-25 17:29:54 +08:00
parent 98ef6c7492
commit 6daf0a4d0f
29 changed files with 600 additions and 352 deletions

View File

@ -123,7 +123,7 @@ func (h *relayHandler) Handle(ctx context.Context, conn net.Conn) {
if address != "" {
resp.Status = relay.StatusForbidden
resp.WriteTo(conn)
h.logger.Error("forbidden")
h.logger.Error("forward mode, connect is forbidden")
return
}
// forward mode
@ -132,7 +132,7 @@ func (h *relayHandler) Handle(ctx context.Context, conn net.Conn) {
}
switch req.Flags & relay.CmdMask {
case relay.CONNECT:
case 0, relay.CONNECT:
h.handleConnect(ctx, conn, network, address)
case relay.BIND:
h.handleBind(ctx, conn, network, address)