What I Want:
After a successful connection, I want curl to exit successfully. I am running this command inside a container, so I want the curl command to exit successfully so that the container will too.
Here is my example:
$ 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)
Options I have tried:
No Keep Alive:
$ 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)
Connection Timeout:
$ 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)
Keep Alive Time:
$ 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)
Flag Definitions
--no-keepalive (Disable keepalive use on the connection)
--connect-timeout (SECONDS Maximum time allowed for connection)
--keepalive-time (SECONDS Wait SECONDS between keepalive probes)