How to integrate WebSockets on top of a classic ASP web application?

In one of my projects, I have a very active classic ASP site with the requirement to integrate event-based live events within the existing user interface. In the future, it is planned to upgrade the site architecture to MVC or MVP, but this new feature should be implemented in the meantime.

I decided to go using the WebSocket approach for this, as this is ultimately what we want to use in the future, and rebuilding it does not make sense. The question is how to integrate this with classic ASP architecture?

The site already implements the jQuery library and hopes to use the jQuery features to create these streaming sections on this page.

The current request requests that this feed exist on every page. Thus, loading a new page will re-display the news channel and should be removed from where it remained on the last page. For this, I assume that the position indicator should be read (the session variable that I assume).

In any case, these are requirements. I was thinking of packaging the entire existing classic ASP site in an MVC or MVP (C # /. Net) project so that we can begin to replace obsolete functions as they develop, like this one.

I would like to get some recommendations on some recommended approaches for this scenario.

Thanks.

+4
source share
1 answer

I would make a SignalR application and integrate it into the old application.

Easily integrate ASP classic with ASP.net MVC. Just mix projects and exclude * .asp from routes

routes.IgnoreRoute("{resource}.asp/{*pathInfo}"); 

You will have problems with the root (/), but you can sort it using redirection.

For mixed authentication (if necessary) you will need to write your own authentication in MVC in order to use the same cookie as in classic ASP. I have done this in the past with success.

0
source

Source: https://habr.com/ru/post/1396923/


All Articles