At the beginning of the millennium, the internet cafe was a beacon of the future. But now, amid a lack of affordable housing and a surge in homelessness in New York City, these vestiges of the dot-com boom have become an unlikely safety net, where people pay as little as $7 a night for a roof over their heads. On any given evening in the few remaining 24-hour cybercafes in Manhattan’s Chinatown, chairs are filled with the exhausted bodies of those who have lived there for weeks or months — or by some accounts, even years.

Photo

“It’s like prison,” said Harry Jumonji, describing the tense environment of Freedom Zone on Eldridge Street, where he had been staying with his girlfriend for months. “You got to be high to sleep.”

During the day, the businesses are mostly used by groups of young Chinese gamers. But at night, men and women settle into their spots, their claims staked by shopping bags of clothes, pillows and blankets. Images as varied as a game of Scrabble and pornography flash on monitors. People often rise every few hours to take a break from restless sleep, stretching their legs by going to the front counter to buy a snack or stepping outside for fresh air.

Photo

Tony Lin, bleary-eyed and wearing a T-shirt with an American flag, stood in the hallway on a recent night outside the sapphire glow of a cafe, which is in a building between a karaoke lounge and a day care center. Mr. Lin said he had been staying there for four years after losing his job as a restaurant worker. “I feel so dizzy, I’m so tired,” he said. “I have no hope.”

Follow @NikoKoppel and @nytimesphoto on Twitter. Niko Koppel is also on Instagram. You can also find Lens on Facebook and Instagram.