The most reliable way to stop this is to start all server-side server logic only by accepting commands from the browser. If the key variables are not in the browser (or the copy in the browser is a cached copy and is never accepted as authoritative), then client-side manipulation can do nothing but, perhaps, automate user interface actions.
If the client code must be protected against unauthorized access, you have already lost ; this way lies PunkBuster , Valve Anti-Cheat , and other mechanisms that usually require the user to allow you to constantly install the rootkit on your computer so that you can make sure that it is not cheating.
For some of the projects Iβve been working on lately, using ASP.Net as the back-end, I found SignalR to be a very effective Comet- type link layer for JavaScript and dynamic HTML, even using HTML 5 WebSocket support, if any.
source share