I made a similar proxy using Go in 2019:
https://github.com/alexrsagen/alexproxy
It's got a couple more features than OP, check out the README.
It's got a couple more features than OP, check out the README.
Go was made for this kind of problems. It is very easy to write efficient networking code on go that can be read and understood by mere mortals.