-
Notifications
You must be signed in to change notification settings - Fork 139
Description
How can we obtain the client IP address?
We would like to use the IP address to perform an initial localization of the device, so obtaining the client IP is very important to us.
I have reviewed the Hono documentation but did not find a way to retrieve the client’s IP address.
I am a developer and I am more familiar with Hono’s MQTT Adapter.
To implement this feature in the MQTT Adapter, the following approaches seem feasible:
-
Provide an option to enable the proxy protocol when creating the MQTT server
MqttServerOptions mqttServerOptions = new MqttServerOptions(); mqttServerOptions.setUseProxyProtocol(true);
-
Retrieve the client IP during the client connection via
mqttEndpoint.remoteAddress().host() -
Add a client IP field in the "Connection Event" (or some other mechanism?)
Is this right?
I’m not entirely sure how other adapters would implement this, but it should be similar.
Could this feature be added?