I have an application in MVC 3, and I want to add WebSockets to it (with a departure from Comet).
I did a little research, and I found out that part of the comet is quite simple, and I would rather do it myself. Just AsyncControllers and a fairly simple js bit is all that is required to handle these long-lived ajax requests.
Now, in the case of WebSocket, everything starts to get dirty. I looked at several libraries, but basically they seem to set up a web server (therefore need a different host or port) and listen for ws protocol requests there. For example, for SuperWebSocket , which at first seemed nice, but the problem with it was "I am the web server" (of course, this is normal, but I would prefer to avoid).
Then I looked at “PingIt” or something like that, I can’t find the link now. However, I have a source on another computer. This one works on the endpoint in mvc, but I didn’t really like the way it handles things, for example, it takes an IDisposable object and through the reflector creates a javascript element that is rendered on the client, which is very dirty with their library name, in which I really I was not interested, plus it felt that many of them were thrown against what I could wish for, which contradicts my opinion on how the page should be displayed (especially now that I am working on MVC, which pretty much means that I I can code acce clean, unobtrusive html-pages).
Basically, I want my endpoints to be something like:
domain.com/rt/comet
domain.com/rt/socket
but not
domain.com/rt/comet
domain.com:81/
So: is it possible to get websocket connections (and do handshakes and all that needs to be done) at the endpoint in the asp.net ASP.NET application controller, instead of setting up tcplistener somewhere?
It will also help me keep the comet code a little closer to my websocket code.
I have to say that I am seriously new to all the work of the comet / websites, so I don’t know much (or any) protocol, I understand how to make the comet work, but not so much on websockets, although I read and understood the basics to understand the essence of this.
Also: please let me know if what I ask does not work.