Stirring constantly and testing frequently, boil 1/3 cup white corn syrup in a small Saucepan for a minute or two until the syrup forms thick, slowly descending strands when dropped from the tip of your spoon. Remove from heat, and stir in 3 tablespoons of water. Sift 2 tablespoons unsweetened cocoa powder into a bowl with 1/3 cup sugar and a pinch of salt, and blend thoroughly (to prevent cocoa from lumping later); stir into the hot syrup. Bring to simmer, and cook slowly for a minute or two, stirring, until sugar granules have dissolved completely. Then bring to full boil for 5 seconds; remove from heat and stir in 1/2 teaspoon pure vanilla extract. (You may wish to test the sauce over a spoonful of ice cream. If it is, too thick or stiff, stir in droplets of water. If it is too thin, boil it up again for a few seconds.)
Source: Julia Child