I'm using a node module to create http proxy servers (node-socks)like this:
const { http } = require('@sansamour/node-socks')
http.createServer({
authorization: function(u,p){
return u == 'KeemROH' && p == 'Test'
},
port: 5000
});
http.createServer({
authorization: function(u,p){
return u == 'KeemROH' && p == 'Test'
},
port: 5001
});
http.createServer({
authorization: function(u,p){
return u == 'KeemROH' && p == 'Test'
},
port: 5002
});
http.createServer({
authorization: function(u,p){
return u == 'KeemROH' && p == 'Test'
},
port: 5003
});
http.createServer({
authorization: function(u,p){
return u == 'KeemROH' && p == 'Test'
},
port: 5004
});
Would it maybe be possible to make a loop that would maybe run:
http.createServer({
authorization: function(u,p){
return u == 'KeemROH' && p == 'Test'
},
port: 5000 // add +1 each loop so 5000, 5001, 5002, 5003, 5004 ect.
});
And have it loop a set number of times? So instead of rewriting it a number of times this can be the solution