Attempt a socket-level connection via the given proxy to TargetAddress. The Proxy argument must match the output argument of proxy_for_url/3. The predicate tcp_connect/3 (and http_open/3 from the library(http/http_open)) collect the results of failed proxies and raise an exception no proxy is capable of realizing the connection.
The default implementation recognises the values for Proxy described below. The library(http/http_proxy) adds proxy(Host,Port) which allows for HTTP proxies using the CONNECT method.
- proxy_error(Message) if the proxy connection is not successful.