1

I'm developing a PSGI app in Catalyst that uses WebSockets for communication between the front- and back-end. Basically what we do, is as soon as the user session is authenticated, we open a websocket to the back-end, load the JS app on the client (Angular) and retrieve any requested data or tasks from/to the back-end via the websocket (event-based using AnyEvent).

The system works really well, but there's a really annoying issue:

Every time the user does a page-reload, the websocket is killed. This is something that we expected to happen, because the socket is opened via JS (which is being reloaded on a page refresh). For the final implementation, this won't be an issue (we simply redirect the user to the login page on every page reload). But during development, this is obviously very annoying. Every time the front-end dev does a minor change to the JS, he has to login again, etc.

I would very much try to avoid developing the entire thing in CGI as well, so it could be used for development.

Does anybody have a solution for this? Is there a particular websocket development server one could use?

Currently the PSGI app is running on Twiggy. The weird thing is, that on some machines it is refresh-safe, and on other machines it isn't (same OS, twiggy, perl, catalyst version).

Any help would be much appreciated!

RandomAndy
  • 324
  • 1
  • 9

0 Answers0