[Libwebsockets] HTTP transaction before upgrading to WebSockets

sthustfo sthustfo at gmail.com
Mon Aug 18 17:26:30 CEST 2014


Hey Andy,

Thanks for the suggestions. I will look at the suggested options and get
back in case I have any further queries.

Cheers.


On Mon, Aug 18, 2014 at 4:38 PM, Andy Green <andy at warmcat.com> wrote:

>
>
> On 18 August 2014 18:07:47 GMT+08:00, sthustfo <sthustfo at gmail.com> wrote:
> >Hi All,
> >
> >Is it possible to perform an HTTP GET transaction and then later
> >upgrade to
> >WS? If so, is there any sample code which I can look at for the HTTP
> >request and response? Any other pointers also appreciated.
>
> Andrew Canaday added support for HTTP keep-alive (http 1.1) recently, on
> the server side this should allow it OK already in git HEAD.
>
> But for lws client side, you'll need to do some work if that's what you
> want.
>
> Something like
>
> 1) patch the client connect code before it sends the upgrade headers, so
> that it can optionally send user callback-provided headers instead,
> delaying sending the upgrade header until the callback says go ahead (by
> returning the default 0).
>
> 2) patch the client response processing stuff to do the same trick, if the
> upgrade header had not yet been sent, give the user callback a chance to
> process the response data instead and only treat it like normal when the
> upgrade header had been sent
>
> Does it make sense?
>
> -Andy
>
> >Thanks.
> >
> >
> >------------------------------------------------------------------------
> >
> >_______________________________________________
> >Libwebsockets mailing list
> >Libwebsockets at ml.libwebsockets.org
> >http://ml.libwebsockets.org/mailman/listinfo/libwebsockets
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://libwebsockets.org/pipermail/libwebsockets/attachments/20140818/144816b4/attachment-0001.html>


More information about the Libwebsockets mailing list