In that case, I should clone resty.http and implement your library myself? I’m not sure if I’m experienced enough for that. Actually, I opened an issue asking resty.http creators to do that.
Unless your library implements luasocket/luasec.http into cosocket, in that case I could simply use that.
PS: It looks like your library is not available at opm.
Thanks for your reply!
> On 31 Jul 2017, at 14:10, Thibault Charbonnier <thiba...@fastmail.com> wrote:
>
> Hi,
>
> On 7/30/17 4:46 PM, Yan Gabriel Minário wrote:
>> resty.http worked very well for me so far, but I’d like to make my telegram bot library useable outside openresty, so I’d like to know if there’s such library. If not, what is the closest thing to resty.http and how to fallback properly?
>
> I built a fallback library which, if used, will always use cosockets where available, and fallback to LuaSocket/LuaSec where cosockets are not available (non-supported ngx_lua contexts, or non-ngx_lua interpreters). It was inspired by a similar module in pgmoon and improved/externalized as an independent library here:
>
> https://github.com/thibaultcha/lua-resty-socket
>
> Of course, it needs to be used by the library (lua-resty-http does not use it nor does it provide a fallback for non-supported cosocket contexts).
>
> -- Thibaul.