relay: added private tunnel

This commit is contained in:
ginuerzh
2023-01-29 11:55:26 +08:00
parent 93b40f4c86
commit 24037aba7b
11 changed files with 174 additions and 59 deletions

View File

@ -83,11 +83,13 @@ func (c *relayConnector) Connect(ctx context.Context, conn net.Conn, network, ad
if err := af.ParseFrom(address); err != nil {
return nil, err
}
req.Features = append(req.Features, af)
}
// forward mode if port is 0.
if af.Port > 0 {
req.Features = append(req.Features, af)
}
if !c.md.tunnelID.IsZero() {
req.Features = append(req.Features, &relay.TunnelFeature{
ID: c.md.tunnelID,
})
}
if c.md.noDelay {