Add WebSocket support and enhance chat functionality

- Implement WebSocket handling in the FastCGI server, allowing for real-time communication.
- Introduce functions for managing WebSocket connections, broadcasting messages, and sending to specific connections.
- Create a chat interface in the `websockets.ws.uce` file, including message handling and user notifications.
- Refactor existing code to accommodate WebSocket integration, ensuring compatibility with HTTP requests.
- Update documentation to reflect new features and usage instructions for WebSocket functionality.
This commit is contained in:
udo
2026-04-18 15:10:15 +00:00
parent cd8f07aaa7
commit 86dc93864e
13 changed files with 794 additions and 110 deletions
+3 -1
View File
@@ -431,7 +431,7 @@ std::map<pid_t, Worker> workers;
#include <sys/resource.h>
#include <sys/prctl.h>
void spawn_subprocess(std::function<void()> exec_after_spawn)
pid_t spawn_subprocess(std::function<void()> exec_after_spawn)
{
parent_pid = getpid();
pid_t p;
@@ -442,6 +442,7 @@ void spawn_subprocess(std::function<void()> exec_after_spawn)
//printf("(C) child procress started, PID:%i\n", my_pid);
prctl(PR_SET_PDEATHSIG, SIGHUP);
exec_after_spawn();
return(0);
}
else
{
@@ -449,6 +450,7 @@ void spawn_subprocess(std::function<void()> exec_after_spawn)
w.pid = p;
workers[w.pid] = w;
printf("(P) child procress spawned: PID %i\n", p);
return(p);
}
}