Farang is also (by coincidence) the Thai word for the guava fruit, which of course can lead to "farang eating farang" jokes from Thai people when eating a guava in Thailand. There is also Maan Farang which is potatoes, hence the similar joke "Farang kin (eat) maan farang". And stranger still there is Mhak Farang which is chewing gum.
The word derives from farangset, which is the Thai pronunciation of Français, the French word for 'French' or 'Frenchman'. France was the first European nation to establish cultural ties with Thailand, in the 17th century, so to Thais at that time, 'white man' and 'Frenchman' were synonymous.