Javascript server side?

后端 未结 4 499

Is it at all possible to use javascript server side and thus not shown in page source for certain core calculations?

I\'m developing a game, and one crucial part of the

相关标签:
4条回答
  • 2021-01-28 06:15

    You'll want to look at node.js. Node.js allows you to run javascript code on the server and is very easy to get up and running to accept and respond to http requests. You'll probably also want to take a look at expressjs which makes implementing a Node.js server even easier.

    0 讨论(0)
  • 2021-01-28 06:15

    There are a variety of ways of doing server side scripting. Node.js is one solution, but even PHP, Ruby, or Python will let you do server side calculations.

    It doesn't matter though, because if your game is heavily client side JS, anyone with a greasemonkey plugin installed can cheat.

    0 讨论(0)
  • 2021-01-28 06:36

    I would also recommend you to check out NowJS (http://nowjs.com/) which will allow you to easily call server functions from client (without exposing their source code).

    now.calculateGameScore(function(data){ ... });

    0 讨论(0)
  • 2021-01-28 06:38

    I would do an AJAX request. Submit raw data to the server and get back the completed data. Use a server side language (PHP) to do the secure calculations. JavaScript on the server side is a real crap shoot.

    0 讨论(0)
提交回复
热议问题