This was adapted from @Ryzerth's work over on SDR++.
https://github.com/AlexandreRouma/SDRPlusPlus/tree/master/spyserver_source/src

Thanks!