Skip to content

Commit

Permalink
+ added server for ipviking.js
Browse files Browse the repository at this point in the history
  • Loading branch information
TingGe committed Apr 20, 2016
1 parent b6fd2e7 commit c856b40
Show file tree
Hide file tree
Showing 37 changed files with 5,765 additions and 613 deletions.
1,296 changes: 683 additions & 613 deletions ipviking/scripts/ipviking.js

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions server/client.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
var WebSocket = require('ws');
var ws = new WebSocket('ws://127.0.0.1:8080');

ws.on('open', function open(){
ws.send('client something');
});

ws.on('message', function(data, flags){
console.log(data);
console.log(flags);
ws.close();
});
32 changes: 32 additions & 0 deletions server/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
var mockData = {
"latitude": "30.58",
"longitude": "114.27",
"countrycode": "CN",
"country": "CN",
"city": "武汉",
"org": "中国湖北省网络",
"latitude2": "38.62",
"longitude2": "-90.35",
"countrycode2": "US",
"country2": "US",
"city2": "洛杉矶",
"type": "ipviking.honey",
"md5": "221.235.189.244",
"dport": "22",
"zerg": "rush"
};

var WebSocketServer = require('ws').Server,
wss = new WebSocketServer({
port: 8080
});

wss.on('connection', function connection(ws) {
ws.on('message', function incoming(message) {
console.log('received: %s', message);
});

mockData.dport = "21";
ws.send(JSON.stringify(mockData));
ws.close();
});
7 changes: 7 additions & 0 deletions server/node_modules/options/.npmignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions server/node_modules/options/Makefile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

69 changes: 69 additions & 0 deletions server/node_modules/options/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

86 changes: 86 additions & 0 deletions server/node_modules/options/lib/options.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

80 changes: 80 additions & 0 deletions server/node_modules/options/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions server/node_modules/ultron/.npmignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions server/node_modules/ultron/.travis.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions server/node_modules/ultron/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c856b40

Please sign in to comment.