Skip to content

use cocos2d-js/html-ajax to transfer protocol buffers in HTTP with NodeJS/SpringMVC——前端cocos2d-js/html-ajax与后端nodejs/springmvc使用protobuf/json/queryString通信的例子

Notifications You must be signed in to change notification settings

whg333/cocos2d-js-ajax-protobuf-nodejs-springmvc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cocos2d-js-ajax-protobuf-nodejs-springmvc

This example shows how to use cocos2d-js/html-ajax to transfer protocol buffers/json/queryString in HTTP with NodeJS/SpringMVC

Instructions for NodeJS

  1. Set up dependencies: npm install
  2. Copy the cocos2d-js frameworks to cocos2d-js directory
  3. Run: node server.js
  4. Open http://localhost:3000 in a recent browser

Instructions for Java/SpringMVC

  1. Import project to your Eclipse
  2. Convert to Maven Project
  3. Run on Server (jetty or tomcat), make sure your server context path is / and port is 3000
  4. Open http://localhost:3000 in a recent browser

Snapshots

below is the TestProtobuf.proto

package TestProtobuf;

option java_package = "com.why.game.protobuf";
option java_outer_classname = "TestProtobuf";

message TestProto{
	optional int32 id = 1;
	optional string name = 2;
}

you will see below Snapshots when you visit http://localhost:3000

1

you can click the link to visit Cocos2d-JS-Protobuf or Html-Ajax-Protobuf as below

2

in the Html-Ajax-Protobuf page you can choose protocol to see how the NodeJS and Java/SpringMVC process protobuf/json/queryString

6

About

use cocos2d-js/html-ajax to transfer protocol buffers in HTTP with NodeJS/SpringMVC——前端cocos2d-js/html-ajax与后端nodejs/springmvc使用protobuf/json/queryString通信的例子

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published