[#ConnectThroughProxy]
= ConnectThroughProxy
:mrdocs:

Connect to a specified destination service through a SOCKS5 proxy by first connecting to the SOCKS5 proxy&period;

== Synopsis

Declared in `&lt;netbase&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::unique&lowbar;ptr&lt;Sock&gt;
ConnectThroughProxy(
    xref:Proxy.adoc[Proxy] const& proxy,
    std::string const& dest,
    uint16&lowbar;t port,
    bool& proxy&lowbar;connection&lowbar;failed);
----

== Return Value

the connected socket if the operation succeeded&period; Otherwise an empty unique&lowbar;ptr&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *proxy* [in]
| The SOCKS5 proxy&period;
| *dest* [in]
| The destination service to which to connect&period;
| *port* [in]
| The destination port&period;
| *proxy&lowbar;connection&lowbar;failed* [out]
| Whether or not the connection to the SOCKS5 proxy failed&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
