The Treaty of Nanjing was signed in 1842. It was the result of the first Opium War. It was the first of what are known as the "Unequal Treaties" because of the fact that the treaties forced concessions from China without giving anything in return.
In the Treaty of Nanjing, the British mainly got things that they wanted for trade purposes. Before the treaty, British merchants could trade only with specified people in one city (Canton). The treaty abolished that system and allowed the British to trade with whoever they wished in Canton and in four other ports.
The other major outcome of the treaty was that Britain took possession of Hong Kong. This gave the British a secure base of operations in China. It allowed them to have an area from which to trade that was completely under their jurisdiction.