enable logging
This commit is contained in:
parent
55bec74af0
commit
acdc83ddda
@ -39,6 +39,7 @@ module.exports = class TCPServer extends Component {
|
|||||||
|
|
||||||
this.server.on('connection', async (socket) => {
|
this.server.on('connection', async (socket) => {
|
||||||
socket.fullAddress = `${socket.remoteAddress}:${socket.remotePort}`;
|
socket.fullAddress = `${socket.remoteAddress}:${socket.remotePort}`;
|
||||||
|
logger(`Connected: ${socket.fullAddress}`);
|
||||||
|
|
||||||
//const loggerPromise = loggingIp(`${this.adr.address}:${this.adr.port}`, socket.remoteAddress, new Date());
|
//const loggerPromise = loggingIp(`${this.adr.address}:${this.adr.port}`, socket.remoteAddress, new Date());
|
||||||
const isFrw = await isFirewalled(socket.remoteAddress);
|
const isFrw = await isFirewalled(socket.remoteAddress);
|
||||||
@ -55,7 +56,6 @@ module.exports = class TCPServer extends Component {
|
|||||||
port: this.syntax.target.split(/:/)[1],
|
port: this.syntax.target.split(/:/)[1],
|
||||||
};
|
};
|
||||||
connections[socket.fullAddress] = net.createConnection(remote.port, remote.ip);
|
connections[socket.fullAddress] = net.createConnection(remote.port, remote.ip);
|
||||||
logger(`${socket.remoteAddress} was been connected, connect to remote created`);
|
|
||||||
|
|
||||||
socket.on('data', (data) => {
|
socket.on('data', (data) => {
|
||||||
logger(`from ${socket.remoteAddress} sended: ${data.length} bytes`);
|
logger(`from ${socket.remoteAddress} sended: ${data.length} bytes`);
|
||||||
|
|||||||
@ -126,7 +126,7 @@ function readInstructions (instructions, fullCode, forDomains=false) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function logger (...p) {
|
function logger (...p) {
|
||||||
return;
|
//return;
|
||||||
console.debug("[DEBUG.routemap]:", ...p);
|
console.debug("[DEBUG.routemap]:", ...p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user