Right now I am using Mosca as an MQTT Broker inside a docker container offering "MQTT" and "MQTT over websocket" protocols.
The challenge I am facing right now is that, because of an humongous problem of docker, the client IP I get from client.connection.stream.remoteAddress is not the correct one.
Normally, when using HTTP protocol, to solve the problem the solution is just adding a reverse proxy before the docker container which add "X-Forwarded-For" header with the real IP to the request.
Such solution just works with HTTP procotols.
Using an nginx server as a reverse proxy, I am adding the header over the websocket request to Mosca:
Hello everyone.
Right now I am using Mosca as an MQTT Broker inside a docker container offering "MQTT" and "MQTT over websocket" protocols. The challenge I am facing right now is that, because of an humongous problem of docker, the client IP I get from client.connection.stream.remoteAddress is not the correct one.
Normally, when using HTTP protocol, to solve the problem the solution is just adding a reverse proxy before the docker container which add "X-Forwarded-For" header with the real IP to the request. Such solution just works with HTTP procotols.
Using an nginx server as a reverse proxy, I am adding the header over the websocket request to Mosca:
The added header seems completly ignored by Mosca and I am not understanding if that's correct or if mosca is just lacking the correct support.
Is there any way to get the real IP from websocket connection ? Or should I follow this idea ?
Any hint would be much appreciated.