Moving the declaration of newctx inside the ifdef USE_WEBSOCKET block