You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/11/22 14:01:54 UTC
[GitHub] [apisix] starsz opened a new issue #2818: [DISCUSS]: Use luasocket lib instead of `curl` in "bin/apisix"
starsz opened a new issue #2818:
URL: https://github.com/apache/apisix/issues/2818
Hi, I advise using luasocket lib instead of `curl` in "bin/apisix".
Although, it's very convenient to get HTTP responses by using "io.open" and "curl".
But, I think it's not an elegant way and has some limitations. Such as can't distinguish error info between `Connection refused` and empty response.
So I think we can use luasocket lib and create a common function in "cli/util.lua", so that we can deal with some HTTP request better in "bin/apisix".
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] moonming commented on issue #2818: [DISCUSS]: Use luasocket lib instead of `curl` in "bin/apisix"
Posted by GitBox <gi...@apache.org>.
moonming commented on issue #2818:
URL: https://github.com/apache/apisix/issues/2818#issuecomment-732249427
yes
Thanks,
Ming Wen
Twitter: _WenMing
YuanSheng Wang <no...@github.com> 于2020年11月23日周一 下午11:42写道:
> Do you mean to run the CLI in fake openresty ENV? Is it the same as the
> "resty" command?
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <https://github.com/apache/apisix/issues/2818#issuecomment-732241227>, or
> unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AGJZBK47SYHTQ6E4TJCSUQDSRJ7HDANCNFSM4T6PYCLA>
> .
>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] tokers closed issue #2818: [DISCUSS]: Use luasocket lib instead of `curl` in "bin/apisix"
Posted by GitBox <gi...@apache.org>.
tokers closed issue #2818:
URL: https://github.com/apache/apisix/issues/2818
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] tokers removed a comment on issue #2818: [DISCUSS]: Use luasocket lib instead of `curl` in "bin/apisix"
Posted by GitBox <gi...@apache.org>.
tokers removed a comment on issue #2818:
URL: https://github.com/apache/apisix/issues/2818#issuecomment-731894547
What about just use luasocket?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] spacewander commented on issue #2818: [DISCUSS]: Use luasocket lib instead of `curl` in "bin/apisix"
Posted by GitBox <gi...@apache.org>.
spacewander commented on issue #2818:
URL: https://github.com/apache/apisix/issues/2818#issuecomment-731881526
Do you mean writing a new HTTP client based on luasocket? Since lua-resty-http can't be used without `ngx`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] membphis commented on issue #2818: [DISCUSS]: Use luasocket lib instead of `curl` in "bin/apisix"
Posted by GitBox <gi...@apache.org>.
membphis commented on issue #2818:
URL: https://github.com/apache/apisix/issues/2818#issuecomment-732212841
We can make a try.
Need to pay attention to the use of different systems(ubuntu, centos and mac os), whether there are compatibility issues.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] starsz commented on issue #2818: [DISCUSS]: Use luasocket lib instead of `curl` in "bin/apisix"
Posted by GitBox <gi...@apache.org>.
starsz commented on issue #2818:
URL: https://github.com/apache/apisix/issues/2818#issuecomment-731904885
> But i'm not sure whether it's built in? Or users have to install it before they can use `bin/apisix`.
Users need to do `make deps` before they use `bin/apisix`. So I think it can be solved.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] tokers commented on issue #2818: [DISCUSS]: Use luasocket lib instead of `curl` in "bin/apisix"
Posted by GitBox <gi...@apache.org>.
tokers commented on issue #2818:
URL: https://github.com/apache/apisix/issues/2818#issuecomment-731894547
What about just use luasocket?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] tokers commented on issue #2818: [DISCUSS]: Use luasocket lib instead of `curl` in "bin/apisix"
Posted by GitBox <gi...@apache.org>.
tokers commented on issue #2818:
URL: https://github.com/apache/apisix/issues/2818#issuecomment-731894703
> Do you mean writing a new HTTP client based on luasocket? Since lua-resty-http can't be used without `ngx`.
The luasocket lib already has a HTTP client implementation.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] spacewander commented on issue #2818: [DISCUSS]: Use luasocket lib instead of `curl` in "bin/apisix"
Posted by GitBox <gi...@apache.org>.
spacewander commented on issue #2818:
URL: https://github.com/apache/apisix/issues/2818#issuecomment-732513368
There are some limitation in `resty`, for instance, access environment variables.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] starsz commented on issue #2818: [DISCUSS]: Use luasocket lib instead of `curl` in "bin/apisix"
Posted by GitBox <gi...@apache.org>.
starsz commented on issue #2818:
URL: https://github.com/apache/apisix/issues/2818#issuecomment-732625779
Hi, @moonming, I think there is no need to use `lua-resty-http`.
In CLI, we don't care about non-blocking, and luasocket is also easy to use now.
What's your opinion about using `lua-resty-http`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] tokers commented on issue #2818: [DISCUSS]: Use luasocket lib instead of `curl` in "bin/apisix"
Posted by GitBox <gi...@apache.org>.
tokers commented on issue #2818:
URL: https://github.com/apache/apisix/issues/2818#issuecomment-731902015
But i'm not sure whether it's built in? Or users have to install it before they can use `bin/apisix`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] moonming commented on issue #2818: [DISCUSS]: Use luasocket lib instead of `curl` in "bin/apisix"
Posted by GitBox <gi...@apache.org>.
moonming commented on issue #2818:
URL: https://github.com/apache/apisix/issues/2818#issuecomment-732216263
Can we specify the path of openresty to solve this problem? So we can use lua-resty-http.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] starsz edited a comment on issue #2818: [DISCUSS]: Use luasocket lib instead of `curl` in "bin/apisix"
Posted by GitBox <gi...@apache.org>.
starsz edited a comment on issue #2818:
URL: https://github.com/apache/apisix/issues/2818#issuecomment-731901768
Hi, @spacewander @tokers, Yeah, luasocket had an HTTP client implementation already.
See: [doc](http://w3.impa.br/~diego/software/luasocket/http.html)
So, I want to use luasocket lib instead of curl in "bin/apisix".
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] membphis commented on issue #2818: [DISCUSS]: Use luasocket lib instead of `curl` in "bin/apisix"
Posted by GitBox <gi...@apache.org>.
membphis commented on issue #2818:
URL: https://github.com/apache/apisix/issues/2818#issuecomment-732241227
Do you mean to run the CLI in fake `openresty` ENV? Is it the same as the "resty" command?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] starsz commented on issue #2818: [DISCUSS]: Use luasocket lib instead of `curl` in "bin/apisix"
Posted by GitBox <gi...@apache.org>.
starsz commented on issue #2818:
URL: https://github.com/apache/apisix/issues/2818#issuecomment-731901768
Hi, @spacewander @tokers, Yeah, luasocket had an HTTP client implementation already.
See: http://w3.impa.br/~diego/software/luasocket/http.html
So, I want to use luasocket lib instead of curl in "bin/apisix".
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] tokers commented on issue #2818: [DISCUSS]: Use luasocket lib instead of `curl` in "bin/apisix"
Posted by GitBox <gi...@apache.org>.
tokers commented on issue #2818:
URL: https://github.com/apache/apisix/issues/2818#issuecomment-731905103
> > But i'm not sure whether it's built in? Or users have to install it before they can use `bin/apisix`.
>
> Users need to do `make deps` before they use `bin/apisix`. So I think it can be solved.
OK, that's good.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org