AN_SET_PROXYSection: Antinat Programmer's Manual (3)
Index Return to Main Contents
The an_set_proxy(3) function is used to specify the proxy server to use and other characteristics associated with the socket. This function allows fine-grained control of how a proxy can be configured; a simpler interface is available in the form of an_set_proxy_url(3). This function can only be used to define a connection to a proxy server. If you want the socket to connect directly, without a proxy server, use the an_unset_proxy(3) function. The default values are determined by the AN_PROXY environment variable.
s is a socket previously created with an_new_connection(3).
proxy_type is the type of proxy to use. Currently, the library supports the following values: AN_SERV_SOCKS4, AN_SERV_SOCKS5 and AN_SERV_HTTPS. AN_SERV_SSL is retained for compatibility and is the same as AN_SERV_HTTPS.
packet_family is the packet family to use for connections to the proxy. This can be AN_PF_INET for an IP-based connection, or AN_PF_INET6 for an IPv6 based connection, if Antinat has been compiled with IPv6 support.
proxy_hostname is the hostname, in NULL-terminated character format, that should be used to connect to. This parameter cannot be NULL. There is no mechanism to specify the location of the proxy server in sockaddr structures; all future applications should use hostnames in preference for increased flexibility.
- The socket handle is invalid, or the hostname is invalid.
- There was not enough memory remaining to allocate space to store the proxy hostname.
- An attempt was made to specify a proxy server type not supported by this library. Note that this function cannot be used to establish direct connections; use the an_unset_proxy(3) function instead.
Malcolm Smith <email@example.com>
Time: 14:19:44 GMT, January 09, 2005