A documented Cowboy Stream Handler reference implementation

Hi everyone!

I had to write a cowboy stream handler for work this week, and in the process, I put together this little reference module with comments to use as a jumping off point for when I have to write these in the future. Someone pointed out that I should share it online, so here it is! Figured others might find a use for it.

15 Likes

Brilliant! I did something similar a while ago too, but not as diligently commented as yours:

7 Likes

This is excellent. Does someone know if something similar exists for ranch protocol handlers?

1 Like

Awesome, thanks to both of you guys. Been looking for something like this lately in the cowboy examples. Maybe this would be worth a PR?

There are two example implementations of ranch_protocol shipping with ranch. The tcp_echo one is very simplicistic, tcp_reverse is more advanced and implemented as a gen_statem.

2 Likes