mirror of
https://github.com/coder/code-server.git
synced 2025-08-01 06:23:35 +08:00
Hook up shared process sorta
This commit is contained in:
@ -25,12 +25,6 @@ export const createApp = (registerMiddleware?: (app: express.Application) => voi
|
||||
};
|
||||
|
||||
wss.on("connection", (ws: WebSocket, req) => {
|
||||
const spm = (<any>req).sharedProcessInit as SharedProcessInitMessage;
|
||||
if (!spm) {
|
||||
ws.close();
|
||||
return;
|
||||
}
|
||||
|
||||
const connection: ReadWriteConnection = {
|
||||
onMessage: (cb): void => {
|
||||
ws.addEventListener("message", (event) => cb(event.data));
|
||||
@ -44,7 +38,7 @@ export const createApp = (registerMiddleware?: (app: express.Application) => voi
|
||||
...options,
|
||||
forkProvider: (message: NewSessionMessage): ChildProcess => {
|
||||
let proc: ChildProcess;
|
||||
|
||||
|
||||
if (message.getIsBootstrapFork()) {
|
||||
proc = forkModule(message.getCommand());
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user