Add support for timeout and connect_timeout