A raw connection like that is very dangerous. Any XSS script in the user’s web browser can exploit that and send commands to click OK on a rootkit install dialog.
And since both Linux and Android support SSL very well, and SSL is easy to use, this is a an even better idea.
With it you just have to call one function to auto-negotiate an SSL connection based on a optional config file.
openssl s_client and
openssl s_server commands for how easy it is.