[Libwebsockets] Denying a Connection

Andy Green andy at warmcat.com
Sat Apr 14 12:40:40 CEST 2018



On 04/14/2018 06:39 PM, Mooki Moo wrote:
> That was quick, thank you.
> 
> I appreciate and unserstand the pupae / butterfly analogy,  but due to
> the fact that I know I can expect multiple clients from the same IP
> (NAT) from my understanding of the documentation the
> LWS_WITH_PEER_LIMITS approach will not work for me. So I need a
> solution that will allow multiple connections from the same IP but
> only allow one from a distinct user.
> 
> As I see it I have a couple of options; the first is to drop the
> existing connection, and allow the new one to proceed. Or mark the
> request to be dropped then drop it via the LWS_CALLBACK_ESTABLISHED
> reason.
> 
> Either way I should be able to inform the user via the
> lws_close_reason as I already have a connection for scenario A I can
> provide a reason as to why the connection was dropped, and the same
> for scenario B as the connection will have metamorphosed in to a wss
> connection at the LWS_CALLBACK_ESTABLISHED point.
> 
> Does this make sense?
> 

Everything makes sense except why any of what "you need a solution for" 
is my problem.

-Andy



More information about the Libwebsockets mailing list