TCP-Socket-Client über Proxy auf NodeJS
Ich muss eine TCP-Socket-Verbindung zum SMTP-Server herstellen. Ist es möglich, eine Verbindung über einen Proxyserver auf NodeJS herzustellen? Stehen npm-Module zur Verfügung? Ich konnte überhaupt keine finden.
var net = require('net');
var HOST = '127.0.0.1';
var PORT = 6969;
var client = new net.Socket();
client.connect(PORT, HOST, function() {
console.log('CONNECTED TO: ' + HOST + ':' + PORT);
client.write('I am here!');
});
// Add a 'data' event handler for the client socket
// data is what the server sent to this socket
client.on('data', function(data) {
console.log('DATA: ' + data);
});
// Add a 'close' event handler for the client socket
client.on('close', function() {
console.log('Connection closed');
});