<div dir="ltr"><div class="gmail_default" style="font-size:small">That's how I do it, in my protocol callback function.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"> case LWS_CALLBACK_FILTER_PROTOCOL_CONNECTION:<br></div>        {<br>            char client_name[512];<br>            char remote_client_ip[64];<br>            int fd = 0;<br>            if (wsi)<br>                fd = lws_get_socket_fd(wsi);<br><br>            lws_get_peer_addresses(wsi, fd,<br>                                client_name, sizeof(client_name),<br>                                remote_client_ip, sizeof(remote_client_ip));<br><br>            websocket->log(LOG_INFO, "<span class="gmail_default" style="font-size:small">WS </span>protocol: websocket request from %s (%s)",<br>                                client_name, remote_client_ip);<br>            break;<br>        }<div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Nov 8, 2019 at 11:26 AM Stefano Mora <<a href="mailto:stefano.mora@newdep.com">stefano.mora@newdep.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">




<div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Hi all,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
is there a way to get the IP address of the connected client(s) ?</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
In which phase I can obtain it/them?</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
I saw the lws_get_peer_addresses function but I don't have the fd parameter..</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Thanks</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div id="gmail-m_-5678586894630267828Signature">
<div id="gmail-m_-5678586894630267828divtagdefaultwrapper" dir="ltr" style="color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols;font-size:12pt;background-color:rgb(255,255,255)">
<p style="margin-top:0px;margin-bottom:0px"><br>
</p>
<p style="margin-top:0px;margin-bottom:0px"></p>
<p class="MsoNormal" style="margin-top:0px;margin-bottom:7.5pt;line-height:9pt">
<span style="font-size:8pt;color:rgb(33,33,33)">Stefano Mora</span><span style="font-size:8pt;color:rgb(33,33,33)"> / SW Engineer<br>
</span><span style="font-size:8pt;color:rgb(46,116,181)"><a href="mailto:stefano.mora@newdep.com" target="_blank">stefano.mora@newdep.com</a></span><span style="font-size:8pt;color:rgb(33,33,33)"></span></p>
<p class="MsoNormal" style="margin-top:0px;margin-bottom:7.5pt;line-height:9pt">
<span style="color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols;font-size:12pt"> </span><br>
</p>
<br>
<p style="margin-top:0px;margin-bottom:0px"></p>
</div>
</div>
</div>

_______________________________________________<br>
Libwebsockets mailing list<br>
<a href="mailto:Libwebsockets@ml.libwebsockets.org" target="_blank">Libwebsockets@ml.libwebsockets.org</a><br>
<a href="https://libwebsockets.org/mailman/listinfo/libwebsockets" rel="noreferrer" target="_blank">https://libwebsockets.org/mailman/listinfo/libwebsockets</a><br>
</blockquote></div>