var request = require('request');
var url="http://127.0.0.1:20391/global";
var touch1 = [
{"action": 0, "x": 500, "y": 1200, "pointer": 1, "delay": 1},
{"action": 2, "x": 500, "y": 1100, "pointer": 1, "delay": 20},
{"action": 2, "x": 500, "y": 1000, "pointer": 1, "delay": 20},
{"action": 1, "x": 1, "y": 1, "pointer": 1, "delay": 20}
];
var touch2 = [
{"action": 0, "x": 800, "y": 1200, "pointer": 2, "delay": 1},
{"action": 2, "x": 800, "y": 1100, "pointer": 2, "delay": 20},
{"action": 2, "x": 800, "y": 1000, "pointer": 2, "delay": 20},
{"action": 1, "x": 800, "y": 1, "pointer": 2, "delay": 20}
];
var p = {
"type": "multiTouch",
"arrays": [touch1,touch2],
"timeout":1000
};
var data = JSON.stringify(p);
request({
url: url,
method: "POST",
json: true,
headers: {
"content-type": "application/json",
},
body: data
}, function(error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body)
}
}