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

@ -48,7 +48,7 @@ func (c *relayConnector) tunnel(ctx context.Context, conn net.Conn, log logger.L
if err != nil {
return nil, err
}
log.Debugf("create tunnel %s connector %s OK", c.md.tunnelID, cid)
log.Debugf("create tunnel %s connector %s OK", c.md.tunnelID.String(), cid)
session, err := mux.ServerSession(conn)
if err != nil {
@ -90,7 +90,7 @@ func (c *relayConnector) initTunnel(conn net.Conn) (addr net.Addr, cid relay.Con
}
if resp.Status != relay.StatusOK {
err = fmt.Errorf("%d: create tunnel %s failed", resp.Status, c.md.tunnelID)
err = fmt.Errorf("%d: create tunnel %s failed", resp.Status, c.md.tunnelID.String())
return
}