0

const httpServer = http.createServer();

// setup sticky sessions setupMaster(httpServer, { loadBalancingMethod: "least-connection", });

How to enable sticky sessions ,similar to node in nest js .

Nest js is framework is it possible to enable sticky session for clustering.

IMSoP
  • 89,526
  • 13
  • 117
  • 169
Rick
  • 11
  • 2
  • nest js enable sticky session , for sticky session need httpserver refrence and have to run nest js app.useWebSocketAdapter(new SocketAdapter(app)); – Rick Apr 26 '23 at 13:49

1 Answers1

0

You can use sticky-session library for this purpose.

// Replace 'httpServer' with the server instance you want to use (e.g., Express)
sticky.listen(httpServer, 3000, () => {
  console.log('Server started on port 3000');
});
Mardin
  • 11
  • 2