WebSocketListener icon indicating copy to clipboard operation
WebSocketListener copied to clipboard

How to use OnHttpNegotiation in 3.0.0

Open TechAspirant opened this issue 5 years ago • 0 comments

Hello,

I am having .Net core 2.1 Application with nuget package version 3.0.0, I am getting error while using OnHttpNegotiation in my application as below as it expects return type and I dnt know how to use in Websocketlistner options

`var wsoptions = new vtortola.WebSockets.WebSocketListenerOptions()
            {
                OnHttpNegotiation = (request, response) =>
                {
                    if (request.RequestUri.ToString() == "/1")
                    {
                        response.Status = vtortola.WebSockets.HttpStatusCode.BadRequest;
                    }
                    else
                    {
                        response.Status = vtortola.WebSockets.HttpStatusCode.Accepted;
                    }
                }
            };`

TechAspirant avatar May 06 '20 18:05 TechAspirant