@@ -383,6 +383,7 @@ struct Inner<H> {
383383 handle : * mut curl_sys:: CURL ,
384384 header_list : Option < List > ,
385385 resolve_list : Option < List > ,
386+ connect_to_list : Option < List > ,
386387 form : Option < Form > ,
387388 error_buf : RefCell < Vec < u8 > > ,
388389 handler : H ,
@@ -625,6 +626,7 @@ impl<H: Handler> Easy2<H> {
625626 handle : handle,
626627 header_list : None ,
627628 resolve_list : None ,
629+ connect_to_list : None ,
628630 form : None ,
629631 error_buf : RefCell :: new ( vec ! [ 0 ; curl_sys:: CURL_ERROR_SIZE ] ) ,
630632 handler : handler,
@@ -885,6 +887,24 @@ impl<H> Easy2<H> {
885887 self . setopt_long ( curl_sys:: CURLOPT_PORT , port as c_long )
886888 }
887889
890+ /// Connect to a specific host and port.
891+ ///
892+ /// Each single string should be written using the format
893+ /// `HOST:PORT:CONNECT-TO-HOST:CONNECT-TO-PORT` where `HOST` is the host of
894+ /// the request, `PORT` is the port of the request, `CONNECT-TO-HOST` is the
895+ /// host name to connect to, and `CONNECT-TO-PORT` is the port to connect
896+ /// to.
897+ ///
898+ /// The first string that matches the request's host and port is used.
899+ ///
900+ /// By default, this option is empty and corresponds to
901+ /// [`CURLOPT_CONNECT_TO`](https://curl.haxx.se/libcurl/c/CURLOPT_CONNECT_TO.html).
902+ pub fn connect_to ( & mut self , list : List ) -> Result < ( ) , Error > {
903+ let ptr = list:: raw ( & list) ;
904+ self . inner . connect_to_list = Some ( list) ;
905+ self . setopt_ptr ( curl_sys:: CURLOPT_CONNECT_TO , ptr as * const _ )
906+ }
907+
888908 // /// Indicates whether sequences of `/../` and `/./` will be squashed or not.
889909 // ///
890910 // /// By default this option is `false` and corresponds to
0 commit comments