@@ -383,6 +383,7 @@ struct Inner<H> {
383
383
handle : * mut curl_sys:: CURL ,
384
384
header_list : Option < List > ,
385
385
resolve_list : Option < List > ,
386
+ connect_to_list : Option < List > ,
386
387
form : Option < Form > ,
387
388
error_buf : RefCell < Vec < u8 > > ,
388
389
handler : H ,
@@ -625,6 +626,7 @@ impl<H: Handler> Easy2<H> {
625
626
handle : handle,
626
627
header_list : None ,
627
628
resolve_list : None ,
629
+ connect_to_list : None ,
628
630
form : None ,
629
631
error_buf : RefCell :: new ( vec ! [ 0 ; curl_sys:: CURL_ERROR_SIZE ] ) ,
630
632
handler : handler,
@@ -885,6 +887,24 @@ impl<H> Easy2<H> {
885
887
self . setopt_long ( curl_sys:: CURLOPT_PORT , port as c_long )
886
888
}
887
889
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
+
888
908
// /// Indicates whether sequences of `/../` and `/./` will be squashed or not.
889
909
// ///
890
910
// /// By default this option is `false` and corresponds to
0 commit comments