I'm stuck with a Socket.io exchange. If the javascript code is hosted inside a browser ( Chrome/Firefox) the connection is working with or without proxy in the middle.
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.1.1/socket.io.js"></script>
<script>
var socket = io('https://uri', { secure: true, reconnect: true, rejectUnauthorized: false });
socket.on('connect', function () {
console.log('Connected to server!');
socket.emit('register', 'ClientName');
});
</script>
On the contrary, the same code run on nodejs, using node v10.4.0 and the module "socket.io": "^2.1.1" is working ONLY if the connection is direct.
I've tried to use socket.io-proxy (quite old), but is seems it is not aligned with socket.io-client, and it does not work, or I'm missing something.
It is clear that the "in browser script" can access to the proxy settings/channel...whatever, or to some other setting that node runtime is not aware of.
Thanks for any suggestion.
Lorenzo