The reaction mechanism of the sulfur cathode in the microporous carbon during discharge was observed by operando XAS.