In a medium saucepan, combine the coconut milk, whole milk, sugar, and salt. Heat over medium heat, stirring occasionally until the sugar dissolves and the mixture is warm but not boiling.
In a small bowl, whisk together the cornstarch and 1/4 cup of cold water until smooth.
Slowly pour the cornstarch mixture into the warm milk mixture, whisking constantly to avoid lumps. Continue to cook over medium heat, stirring frequently, until the mixture thickens and starts to bubble, about 5-7 minutes.
Remove the saucepan from heat and stir in the vanilla extract.
Pour the mixture into a square or rectangular dish and spread it evenly. Allow it to cool to room temperature, then cover and refrigerate for at least 2 hours or until set.
Once set, cut the haupia into squares and serve chilled, garnished with shredded coconut if desired.