dataconnect
New Pleskian
- Server operating system version
- Almalinux 9.2
- Plesk version and microupdate number
- 18.0.61
We are operating 8 servers with Plesk, hosting several Single Page Applications (SPAs) built with PHP and JavaScript, using a custom JS router. These applications handle daily tasks for our customers.
Several customers have requested a security feature to ensure a user is not logged in on multiple devices simultaneously. If a user logs in on a new device, they should be logged out from any previous device.
(YES, we can build and have built Next.js apps with Express and Socket.io, but these next.js does not work on Plesk out of the box)
When a user reloads on another device, it checks if the user is still logged in and redirects if not. However, this is based on user input and does not meet the requirement for real-time checks.
We are using PHP socket server (Ratchet) to handle login checks and potentially future features like popup messages and live chat.
While everything works perfectly in our local development environment, we encounter issues in our production environment. The WebSocket connection does not start.
We tried disabling Nginx proxy mode as suggested in some posts, but it still doesn't work.
We are getting a response so we know that it tries to start.
WebSocket URL: wss://domain.com:8081 socket.js:14:9Object { ws: WebSocket, login: login(loginid, sessionid) }login: function login(loginid, sessionid)ws: WebSocket { url: "wss://domain.com:8081/", readyState: 0, bufferedAmount: 0, … }<prototype>: Object { … }
WebSocket connection closed
close { target: WebSocket, isTrusted: true, wasClean: false, code: 1006, reason: "", srcElement: WebSocket, currentTarget: WebSocket, eventPhase: 2, bubbles: false, cancelable: false, … }
does someone have a idea where to look?
Several customers have requested a security feature to ensure a user is not logged in on multiple devices simultaneously. If a user logs in on a new device, they should be logged out from any previous device.
(YES, we can build and have built Next.js apps with Express and Socket.io, but these next.js does not work on Plesk out of the box)
When a user reloads on another device, it checks if the user is still logged in and redirects if not. However, this is based on user input and does not meet the requirement for real-time checks.
We are using PHP socket server (Ratchet) to handle login checks and potentially future features like popup messages and live chat.
While everything works perfectly in our local development environment, we encounter issues in our production environment. The WebSocket connection does not start.
We tried disabling Nginx proxy mode as suggested in some posts, but it still doesn't work.
We are getting a response so we know that it tries to start.
WebSocket URL: wss://domain.com:8081 socket.js:14:9Object { ws: WebSocket, login: login(loginid, sessionid) }login: function login(loginid, sessionid)ws: WebSocket { url: "wss://domain.com:8081/", readyState: 0, bufferedAmount: 0, … }<prototype>: Object { … }
WebSocket connection closed
close { target: WebSocket, isTrusted: true, wasClean: false, code: 1006, reason: "", srcElement: WebSocket, currentTarget: WebSocket, eventPhase: 2, bubbles: false, cancelable: false, … }
does someone have a idea where to look?