purescript-cookbook icon indicating copy to clipboard operation
purescript-cookbook copied to clipboard

Basic Net/Socket Node Example

Open eviefp opened this issue 4 years ago • 3 comments

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.

eviefp avatar Sep 15 '20 21:09 eviefp

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

JordanMartinez avatar Sep 16 '20 01:09 JordanMartinez

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.

eviefp avatar Sep 16 '20 19:09 eviefp

@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.

afcondon avatar Dec 31 '20 11:12 afcondon