Shanghai is one of the principal seaports of China. The Chinese city proper is enclosed within walls 24 feet high, the streets being narrow and dirty and the buildings low and crowded. In 1843 it was opened as one of the five treaty ports and an important foreign settlement is now established with a separate government. The subjects and citizens of each nationality are under the protection of their respective consuls. The Chinese authorities retain complete control over all customs.