AN_SET_PROXY_URL
Section: Antinat Programmer's Manual (3)Updated: 2005-01-03
Index Return to Main Contents
NAME
an_set_proxy_url - set the location and type of the proxy server
SYNOPSIS
#include <antinat.h>
int an_set_proxy_url(ANCONN s, const char * proxy_url);
DESCRIPTION
The an_set_proxy_url(3) function is used to specify the proxy server to use and the type of that proxy server. This is a simplified interface; for full control over the proxy specification, use the an_set_proxy(3) function.
Proxy URLs are formed as follows: a proxy type, which can be one of: socks4, socks5, or https; followed by the '://' string (without quotes.) Following that is the fully qualified hostname, and optionally, a colon (':') and port number. If not specified, the default port number is 1080. The default values used when a socket is created are determined by the AN_PROXY environment variable.
s is a socket previously created with an_new_connection(3).
url is a NULL-terminated character array specifying the proxy url, described above. An example of this url could be socks4://socks.mycompany.com:10080.
RETURN VALUE
This call returns AN_ERROR_SUCCESS to indicate successful completion.
ERRORS
- AN_ERROR_INVALIDARG
- The socket handle is invalid, or the url is invalid.
- AN_ERROR_NOMEM
- There was not enough memory remaining to allocate space to store the proxy hostname.
- AN_ERROR_NOTSUPPORTED
- 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.
SEE ALSO
an_new_connection(3), an_set_proxy(3), an_unset_proxy(3)
AUTHOR
Malcolm Smith <[email protected]>
Index
Time: 14:19:44 GMT, January 09, 2005