an_set_proxy_url(3) - Linux man page
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 <malxau@users.sourceforge.net>