correct code example for createServer and createClient