The king placed the country under French protection in 1863 and it became part of French Indochina in 1887 .