| 123 | } |
| 124 | |
| 125 | func (s ClientService) ServeConnV2(ctx context.Context, conn net.Conn, streamID StreamID) error { |
| 126 | config := yamux.DefaultConfig() |
| 127 | config.LogOutput = io.Discard |
| 128 | session, err := yamux.Server(conn, config) |
| 129 | if err != nil { |
| 130 | return xerrors.Errorf("yamux init failed: %w", err) |
| 131 | } |
| 132 | ctx = WithStreamID(ctx, streamID) |
| 133 | s.Logger.Debug(ctx, "serving dRPC tailnet v2 API session", |
| 134 | slog.F("peer_id", streamID.ID.String())) |
| 135 | return s.drpc.Serve(ctx, session) |
| 136 | } |
| 137 | |
| 138 | // DRPCService is the dRPC-based, version 2.x of the tailnet API and implements proto.DRPCClientServer |
| 139 | type DRPCService struct { |