Preheat the oven to 300 degrees F.
Place the sugar and 1/4 cup of water in a small pot, and bring to a boil.
When the syrup turns golden, add the chile pepper and cayenne, if using.
Continue to cook the syrup until it becomes a deep amber color.
Add the cayenne, if using, along with the remaining 2 tablespoons of water, and swirl the pot gently to combine.
Fish out the chile and pour the caramel into a loaf pan.
Place the eggs, sweetened condensed milk, evaporated milk, mango, vanilla, and salt in a large bowl, and whisk until smooth.
Pour the mixture through a fine-mesh strainer, over the caramel and into the loaf pan.
Wrap tightly with aluminum foil, place in a larger pan filled with hot water, and bake for one hour and twenty minutes, or until set around the edges but still slightly wobbly toward the center. (When placed in the center of the flan, a thermometer should register 180 degrees F.)
Chill the flan overnight.
Run a thin knife around the sides of the pan, then invert onto a serving platter.
Slice and serve.