The sittings of every court within this state shall be public, and every citizen may freely attend the same, except that in all proceedings and trials in cases for divorce, seduction, rape, assault with intent to commit rape, bastardy , filiation, or a crime formerly defined in sections 130.50, 130.45, and 130.40 of the penal law, the court may, in its discretion, exclude therefrom all persons who are not directly interested therein, excepting jurors, witnesses, and officers of the court.
N.Y. Jud. Law § 4