var express = require('express');
var router = express.Router();

/* GET home page. */
router.post('/', function(req, res) {
	//var param = JSON.parse(req.body.payload);
	console.log(req.body);

	res.send('complete');
});

module.exports = router;

var express = require('express'),
	router = express.Router(),
	net = require('net'),
	fs = require('fs'),
	socketPath = '/tmp/haproxy';


/* GET home page. */
router.post('/', function(req, res) {
	var param = JSON.parse(req.body);
	console.log(req.body);

	fs.stat(socketPath, function (err) {
		if (!err) {
			fs.unlinkSync(socketPath);
		}

		var unixServer = net.createServer(function (sock) {
			sock.write('show health');

			sock.on('data', function (data) {
				winston.debug('DATA: '+data);
				sock.destroy();
			});

		}).listen(socketPath);
	});

	res.send('complete');
});

module.exports = router;

Write the code to read haproxy socket
Write the code to read haproxy socket
