service for complex look up

This commit is contained in:
2020-12-22 20:20:15 -05:00
parent 7d1f4f800f
commit 7053536353
7 changed files with 196 additions and 90 deletions
+16
View File
@@ -0,0 +1,16 @@
'use strict';
const {Host} = require('../models/host');
const {SocketServerJson} = require('../models/socket_server_json');
const conf = require('../app').conf;
const socket = new SocketServerJson({
socketFile: conf.socketFile,
onData: function(data, clientSocket) {
clientSocket.write(JSON.stringify(Host.lookUp(data['domain']) || {host: 'none'}));
},
onListen: function(){
console.log('listening')
}
});