I have in my private network different services, these services are not accessible from the out side (externe).
I'd like that my services be accessible to some users, and this after an authentication process (for this part I use express).
Once the user is authentificared it will be proxiate to the right service, I tried for this the http-proxy module.
Problem: I failed to use correctly http-proxy with express module, and resolve this enigma as wished.
Code: I began by doing this
// Create app with Express
var express = require('express');
var app = express();
// Create a proxy server with http-proxy
var httpProxy = require('http-proxy');
var proxy = httpProxy.createProxyServer();
// Create target params (in the local network)
var serverOne = {target:'ws://172.17.0.3:80',ws:true};
// The use of proxy to expose the service
app.all("/app/", function(req, res) {
console.log('redirecting to Server1');
proxy.web(req, res, serverOne);
})
// The login part
.get('/login', function(req, res) {
res.render('login.ejs');
console.log('Cherche Login');
})
app.listen(8080);
Result:
Can someone help me please to fix this?

