Peel and cut the 3 medium onions into rings or cubes. Season the 4 chicken legs with salt and pepper.
Heat oil in a large saucepan over medium heat. Add the onions and fry for about 5 minutes, until translucent.
Add the chicken legs and fry on all sides for about 5 minutes until browned. Pour in the rum, increase heat to medium-high, and stir until the alcohol has boiled off, about 2 minutes.
Add the chicken broth, cola, and ketchup. Reduce heat to medium and simmer for about 30 minutes, stirring occasionally.
Increase heat to medium-high for the last 3-4 minutes to let the sauce boil down and thicken.