“I saw a novel titled ‘My Beijing,’ which inspired me,” Mr. Murong said. “I thought, ‘I can write that kind of thing as well.’ ”

In 2002, he began his novel of Chengdu. Using a pen name, “The Little Match That Sells Girls” — a twisted reference to Hans Christian Andersen’s “The Little Match Girl” — he posted his chapters online as he wrote them. The evolving novel gained notoriety and was reposted on forums. It was a bawdy page-turner: the protagonist, Chen Zhong, an employee at an automobile oil and parts company, regularly engages in bribery and adultery. There are sex scenes in bars and brothels. One of his best friends is a corrupt police officer.

But the freewheeling nature of the Internet could surprise even Mr. Murong. After posting Chapter 26, he went on a long business trip. He came back to find that someone else had written Chapter 27. “I had been pirated,” he said with a laugh. Now the book had two lives.

Writing on the Internet meant, for the most part, working beyond the curtain of censorship. The print world was different. After Mr. Murong signed a contract to have the Chengdu novel published by Zhou Wen, an entrepreneur, he was forced to cut 10,000 words.

But he had an out. After the book was published, he posted an uncensored manuscript on the Internet, one that was even more complete than the chapter-by-chapter version he had written online. “It did feel liberating,” he said.

Some writers are skeptical that uncensored books on the Internet can have much of an effect. Chan Koonchung, the author of “The Fat Years,” a dystopian novel published in Hong Kong and Taiwan but banned on the mainland, has seen at least two electronic versions of his book posted by fans. But he said he believed that only a small number of mainland Chinese would read it online because it could not be discussed in the news media or any other forum. “Most people don’t know about these books,” Mr. Chan said. “So they’re not going to go onto the Internet to look for them.”

Mr. Murong eventually persuaded another house to publish a complete edition of the Chengdu novel. Publication rights generally last three to five years in China, and publishers putting out editions beyond the first one sometimes feel more confident in reinserting passages that were originally censored.