[Libwebsockets] how to get port number of client side

Roger Light roger at atchoo.org
Fri Oct 2 11:19:37 CEST 2015

Hi Susy,

You should get the socket from lws using libwebsocket_get_socket_fd(),
then use getpeername() to get information about the remote side of the




On Thu, Oct 1, 2015 at 8:11 AM, amber susy <andy.green at linaro.org> wrote:
> Hi all,
> How can I solve, that when a client connects to the websocket server, the
> server gets the information what the port number the client uses is? (port
> on client side)
> I would need this to differentiate clients from same LAN (connecting from
> behind the same router).
> For such clients, the IP -currently without port- is same, thus not enough
> to differentiate them.
> Thanks and Regards
> Susy
> _______________________________________________
> Libwebsockets mailing list
> Libwebsockets at ml.libwebsockets.org
> http://ml.libwebsockets.org/mailman/listinfo/libwebsockets

More information about the Libwebsockets mailing list