purescript-cookbook
purescript-cookbook copied to clipboard
Basic Net/Socket Node Example
Recipe Name
EchoServerNetSocketNode
Each recipe name must be unique. Use PascalCase.
Recipe Description
Create a new server, listen to connections, and echo back the inputs.
There's a HalogenHooks example that could provide a foundation for producing this recipe: https://github.com/JordanMartinez/purescript-cookbook/blob/master/recipes/DriverWebSocketsHalogenHooks/src/Main.purs
I was thinking about a simple server only, as there are a few gotchas that I ran into last night on stream. I could add info in the README on how to test it with nc
or something.
@vladciobanu i have a hacked-up version of websocket-simple
and a main
that demos it here: https://github.com/afcondon/sturdy-garbanzo...does something very similar to what you're suggesting i think
would be a good basis for this recipe...i hesitate to promote the changes i made to websocket-simple more broadly, ie to Pursuit, registry etc because i really don't know if i did it right.