telnet后关闭curl连接

问题描述

我想要的东西:

连接成功后,我希望curl成功退出。我正在容器中运行此命令,因此我希望curl命令成功退出,以便容器也将退出

以下是我的示例:

$ curl -v telnet://google.com:443/
*   Trying 172.217.197.113...
* TCP_NODELAY set
* Connected to google.com (172.217.197.113) port 443 (#0)

我尝试过的选项:

不保持活力:

$ curl -v --no-keepalive telnet://google.com:443/
*   Trying 172.217.197.102...
* TCP_NODELAY set
* Connected to google.com (172.217.197.102) port 443 (#0)

连接超时:

$ curl -v --connect-timeout 5 telnet://google.com:443/
*   Trying 172.217.197.139...
* TCP_NODELAY set
* Connected to google.com (172.217.197.139) port 443 (#0)

保持活动时间:

$ curl -v --keepalive-time 5 telnet://google.com:443/
*   Trying 172.217.197.139...
* TCP_NODELAY set
* Connected to google.com (172.217.197.139) port 443 (#0)

标记定义

--no-keepalive (disable keepalive use on the connection)

--connect-timeout (SECONDS Maximum time allowed for connection)

--keepalive-time (SECONDS Wait SECONDS between keepalive probes)

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)