[Libwebsockets] libwebsocket problem

Andy Green andy at warmcat.com
Thu May 16 08:01:44 CEST 2019

On May 16, 2019 6:19:25 AM GMT+01:00, "Wei, Catherine" <catherine.wei at commscope.com> wrote:
>Thanks for your reply. However, I don't know the parameters, so using
>the lws_get_urlarg_by_name is not useful for me. Do you know how can I
>add a patch to it so that I can in any way get the complete url. Which
>file to patch? Very appreciate for your help.

This api should be enough



>Best regards,
>-----Original Message-----
>From: Andy Green <andy at warmcat.com> 
>Sent: 2019年5月16日 12:35
>To: Wei, Catherine <catherine.wei at commscope.com>;
>libwebsockets at ml.libwebsockets.org
>Subject: Re: [Libwebsockets] libwebsocket problem
>Email Security Warning:
>The following message was sent from an external e-mail address.
>Exercise caution when opening attachments, clicking links, or
>exchanging information.
>On 5/16/19 4:34 AM, Wei, Catherine wrote:
>> Hi, I’m using libwebsocket 3.0.1 in my code. I can only get the url 
>> without query parameters. Is there any interface or any way to get
>> complete url of the client connection?
>Query parameters get parsed out of the url string so they and the path
>part are available separately... you can get hold of them using:
>  * lws_get_urlarg_by_name() - return pointer to arg value if present
>  * \param wsi: the connection to check
>  * \param name: the arg name, like "token="
>* \param buf: the buffer to receive the urlarg (including the name=
>  * \param len: the length of the buffer to receive the urlarg
>  *
>*     Returns NULL if not found or a pointer inside buf to just after
>  *     name= part.
>  */
>lws_get_urlarg_by_name(struct lws *wsi, const char *name, char *buf,
>int len);
>Notice the query string includes the '='.
>> Thanks.
>> Best regards,
>> Catherine
>> _______________________________________________
>> Libwebsockets mailing list
>> Libwebsockets at ml.libwebsockets.org
>> /https%3A%2F%2Flibwebsockets.org%2Fmailman%2Flistinfo%2Flibwebsockets

More information about the Libwebsockets mailing list