Whisk together 1 cup white sugar and 1 cup unsweetened cocoa powder in a saucepan, then whisk 1 cup water in to make it smooth.
Add 1/4 teaspoon salt, and heat over medium heat until boiling, then turn the heat down and simmer for a few minutes.
Remove about a tablespoon of the mixture, and mix with 1 teaspoon corn starch.
Blend the corn starch mixture back in with the 2 teaspoons vanilla extract, and simmer for a few more minutes until thickened - be careful not to burn, keep it low!!
Notes
How to thicken chocolate syrupWe use cornstarch here, if you like it a little thicker, add a little more to the slurry.