Grown in India, it was delivered to Canton, and while China outlawed the trade in 1799, local Cantonese officials were always willing to look the other way for  squeeze money  (a term still used in Hong Kong).
The trade was outlawed by China in 1799, but officials would often accept bribes to allow it.