Boost.Socks Logo

PrevUpHomeNext

connect_v4

Connect to the application server through a SOCKS4 server.

Synopsis

Defined in header <boost/socks/connect_v4.hpp>

template<
    class SyncStream>
endpoint
connect_v4(
    SyncStream& s,
    endpoint const& ep,
    string_view ident_id,
    error_code& ec);
Description

This function establishes a connection to the application server through a SOCKS4 server.

Preconditions

The SyncStream should be connected to a SOCKS4 server. The endpoint must contain an IPv4 address.

Example
boost::asio::connect(s, resolver.resolve(socks_host, socks_service));
socks::io::connect_v4(s, app_host_endpoint, "username", ec);
Parameters

Name

Description

s

SyncStream connected to a SOCKS server.

ep

Application server endpoint.

ident_id

SOCKS client user id.

ec

Error code. SOCKS: A protocol for TCP proxy across firewalls</a>

Convenience header <boost/socks.hpp>


PrevUpHomeNext