create websocket handler and router for mapping websocket paths to functions