server should first return an http response and then inform the socket (callback missing?)