保护JavaScript Web应用程序/游戏的方法有哪些? [英] What are the methods of protecting JavaScript web applications/games?

查看:45
本文介绍了保护JavaScript Web应用程序/游戏的方法有哪些?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

背景故事:我打算在Web应用程序中实现一个休闲游戏,但我不想使用Flash,而只是简单的Javascript。我希望Flash的一个好处是它分发二进制文件而不是源代码,因此更容易保护您的代码不被其他人重用/窃取,或者防止客户端修改代码以欺骗游戏?

Back story: I'm planning to implement a casual game to be deployed in a webapp, but I don't want to use Flash, instead just plain Javascript. One benefit of Flash that I would want though is that it distributes a binary and not the source code so it's easier to protect your code from being reused/stolen by somebody else, or to prevent the client from modifying the code to "cheat" in the game?

所以我的问题是:有什么方法可以同样保护Javascript应用程序?我是否仅限于使用代码混淆器的常用方法?这还够吗?

So my question is: what are the ways to similarly protect a Javascript application? Am I limited to the usual methods of using a code obfuscator? Will that be enough?

推荐答案

使用AJAX让您的游戏验证您控制的服务器代码。如果游戏在某种程度上是多人游戏,这也很有用。验证可以防止有人更改代码以便作弊。

Use AJAX to have your game verify against server code you control. This is also useful if the game is multi-player in someway. Verification prevents someone from changing the code in order to cheat.

此外,Flash完全不会被其他人占用。人们可以下载二进制文件并在任何他们想要的地方发布。并且Flash反编译器确实存在且非常有效。

Also Flash is not immune at all from being taken by someone else. People can download the binary and post it wherever they want. And Flash de-compilers do exist and are quite effective.

这篇关于保护JavaScript Web应用程序/游戏的方法有哪些?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆