[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: RE: Persistent http connection
- From: Tim McCracken <Tim.McCracken@...>
- Date: Thu, 8 Nov 2018 18:04:58 +0000
> All I can attest to is that curl with a cookie jar works. It might
> well be overkill of you need only keepalive, but since I use curl only
> for sites that require me to login, I would not know.
It sounds like you are confusing session state (keeping a session alive) using cookies versus HTTP keep-alive which are two very different things. HTTP keep-alive has nothing to do with being logged in or not. It only affects requests that occur over a very short time span as a previous person posted. For example, if you open a web page with 100 photos on it, each of those 100 photos is a different HTTP request. Keep-alive will enable all those to be downloaded using a single TCP session. But a few seconds after all the pages are down loaded, that TCP session goes away. But the presence or absence of cookies has nothing to do with this. And in fact, session state will work just fine without HTTP keep alive - and can span days, months or years depending on how the cookies are set to expire.
For the original poster: cURL c++ library supports keep-alive - I think they simply refer to it as TCP keep alive. I would be very surprised if the Lua thin wrapper libraries didn't allow support of it as well. You may just need to use a cURL based library if that will otherwise support your needs.