MCPcopy
hub / github.com/socketio/socket.io / randomTarget

Function randomTarget

examples/cluster-engine-redis/server.js:44–50  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

42 const proxy = createProxyServer();
43
44 function randomTarget() {
45 return [
46 "http://localhost:3001",
47 "http://localhost:3002",
48 "http://localhost:3003",
49 ][Math.floor(Math.random() * 3)];
50 }
51
52 const httpServer = createServer((req, res) => {
53 proxy.web(req, res, { target: randomTarget() });

Callers 1

initProxyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected