在telnet之后关闭curl连接

在telnet之后关闭curl连接,curl,containers,telnet,Curl,Containers,Telnet,我想要什么: $ 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 * C

我想要什么:

$ 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)
成功连接后,我希望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)
我尝试过的选项:

$ 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)
没有保持活动状态:

$ 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)
连接超时:

$ 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)
保持活动时间:

$ 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)
标志定义

--无keepalive(在连接上禁用keepalive使用)

--连接超时(允许连接的最长时间为秒)

--保留激活时间(保留激活探测之间的秒等待秒)