Haha yes... although I would be slightly nervous to expose my janky C code to the internet. Where I'm confident it would crash and burn in a very short amount of time :)
Use a proxy. Openresty (nginx+lua) or a Go app would do. Only allow whitelisted commands through like the basic control commands and then pass it on to your C code.