feat: implement custom Next.js server with integrated WebSocket (POC)

- Create apps/nextjs/server.ts custom server integrating WebSocket via ws
- Update nextjs scripts to use custom server for dev and start
- Update root start script to remove separate ws server process
- Update client tRPC URL to connect to port 3000 in dev
- Update nginx.conf to route /websockets to port 3000
- Update Dockerfile and run.sh for integrated server
- Disable standalone ws server dev script
- Add benchmark-memory.sh script

Co-authored-by: ajnart <49837342+ajnart@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]andajnart committed 2026-02-28 08:58:34 +00:00
1 parent 000604bd02
commit c8ae7f283a
11 files changed
+248 -31

No files matched your search

@@ -32,13 +32,12 @@ const getWebSocketProtocol = () => {
};
const constructWebsocketUrl = () => {
const fallback = `${getWebSocketProtocol()}://localhost:3001/websockets`;
if (typeof window === "undefined") {
return fallback;
return `${getWebSocketProtocol()}://localhost:${env.NODE_ENV === "development" ? "3000" : "3001"}/websockets`;
}
if (env.NODE_ENV === "development") {
return fallback;
return `${getWebSocketProtocol()}://localhost:3000/websockets`;
}
return `${getWebSocketProtocol()}://${window.location.hostname}:${window.location.port}/websockets`;