Question: Let say Client1 has a big array in browser (javascript). Client2 has the same array.
Now when Client1 click Shuffle button, this array will sort by randomly. The problem is I want to sync this new order to Client2.  

The idea is I don't want to send all item over network to Client2 because it's big. Then I think about a function `array.shuffle(n)` where n is a random number. The shuffle function use n to sort array somehow. And when I send `n` to Client2, it call the same function and get the same order of array.  

Is there a function like that ?

Answer: 
Just to make everyone aware, I communicated with makers of `Cypress` and got to know that the stubbing of outgoing request is under development and can be tracked under - <https://github.com/cypress-io/cypress/issues/687>
I think you're looking for `onRequest` instead of `onAnyRequest`. [Here's the documentation for `cy.server` options](https://docs.cypress.io/api/commands/server.html#Arguments)