moved simple socket code to host.js