I’ve also tried this and failed constantly, eventually realized that using Golang for this was the better option, I have a example of how i did it in golang here:
Oh… and dont be scared if you don’t know golang yet, I’ve got the hang of it quite quickly!