hook up socket.io and construct function that allows syscalls