service for complex look up
This commit is contained in:
@@ -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')
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user