MINI MINI MANI MO
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>ne_session_proxy</title><link rel="stylesheet" type="text/css" href="../manual.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="ref.html" title="neon API reference"><link rel="prev" href="refsess.html" title="ne_session_create"><link rel="next" href="refsessflags.html" title="ne_set_session_flag"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ne_session_proxy</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="refsess.html">Prev</a> </td><th width="60%" align="center">neon API reference</th><td width="20%" align="right"> <a accesskey="n" href="refsessflags.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="refproxy"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ne_session_proxy, ne_session_socks_proxy, ne_session_system_proxy, ne_set_addrlist — configure proxy servers</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include <ne_session.h></pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">void <b class="fsfunc">ne_session_proxy</b>(</code></td><td>ne_session *<var class="pdparam">session</var>, </td></tr><tr><td> </td><td>const char *<var class="pdparam">hostname</var>, </td></tr><tr><td> </td><td>unsigned int <var class="pdparam">port</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">void <b class="fsfunc">ne_session_system_proxy</b>(</code></td><td>ne_session *<var class="pdparam">session</var>, </td></tr><tr><td> </td><td>unsigned int <var class="pdparam">flags</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">void <b class="fsfunc">ne_session_socks_proxy</b>(</code></td><td>ne_session *<var class="pdparam">session</var>, </td></tr><tr><td> </td><td>enum ne_sock_sversion <var class="pdparam">version</var>, </td></tr><tr><td> </td><td>const char *<var class="pdparam">hostname</var>, </td></tr><tr><td> </td><td>unsigned int <var class="pdparam">port</var>, </td></tr><tr><td> </td><td>const char *<var class="pdparam">username</var>, </td></tr><tr><td> </td><td>const char *<var class="pdparam">password</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">void <b class="fsfunc">ne_set_addrlist</b>(</code></td><td>ne_session *<var class="pdparam">session</var>, </td></tr><tr><td> </td><td>const ne_inet_addr **<var class="pdparam">addrlist</var>, </td></tr><tr><td> </td><td>size_t <var class="pdparam">count</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idm140368850403408"></a><h2>Description</h2><p>One (and no more than one) of the functions
<code class="function">ne_session_proxy</code>,
<code class="function">ne_session_system_proxy</code>,
<code class="function">ne_session_socks_proxy</code>,
<code class="function">ne_set_addrlist</code> can be used to configure
a proxy server for a given session object. If more than one
function is invoked for any given session object, only the
last call has effect. If one of the functions is to be used,
it must be used before the creation of any request object for
the session.</p><div class="refsect2"><a name="idm140368850399584"></a><h3>HTTP proxy specification</h3><p>The <code class="function">ne_session_proxy</code> function
configures use of an HTTP proxy server for the session, the
location of which is given by the
<code class="parameter">hostname</code> and
<code class="parameter">port</code> paramters. If the proxy
requires authentication, <a class="xref" href="refauth.html#ne_set_proxy_auth">ne_set_proxy_auth</a>
should be used.</p></div><div class="refsect2"><a name="idm140368850395840"></a><h3>System proxy configuration</h3><p>The <code class="function">ne_session_system_proxy</code>
function configures the session to use any proxy servers
specified by the system configuration. Support for this
function is platform-specific; if unsupported, the function
has no effect.</p></div><div class="refsect2"><a name="idm140368850393824"></a><h3>SOCKS proxy configuration</h3><p>The <code class="function">ne_session_socks_proxy</code>
function configures the session to use a SOCKS proxy. The
<code class="parameter">version</code> indicates which version of
the SOCKS protocol should be used. The
<code class="parameter">hostname</code> and
<code class="parameter">port</code> parameters specify the SOCKS
proxy location. Note that a server with only an IPv6
address cannot be used with SOCKS v4 or v4A. The
interpretation of the other arguments depends on the version
specified:</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top"><col></colgroup><tbody><tr><td><p><span class="term"><code class="constant">NE_SOCK_SOCKSV4</code> (version 4)</span></p></td><td>The <code class="parameter">username</code> parameter
must be non-<code class="literal">NULL</code>; the <code class="parameter">password</code>
parameter is ignored.</td></tr><tr><td><p><span class="term"><code class="constant">NE_SOCK_SOCKSV4A</code> (version 4A)</span></p></td><td>The <code class="parameter">username</code> parameter
must be non-<code class="literal">NULL</code>; the <code class="parameter">password</code>
parameter is ignored.</td></tr><tr><td><p><span class="term"><code class="constant">NE_SOCK_SOCKSV5</code> (version 5)</span></p></td><td>The <code class="parameter">username</code> parameter
may be <code class="literal">NULL</code>; if it is non-<code class="literal">NULL</code>,
the <code class="parameter">password</code> parameter must also
be non-<code class="literal">NULL</code>; otherwise, it is ignored..</td></tr></tbody></table></div></div><div class="refsect2"><a name="idm140368850377472"></a><h3>Origin server address override</h3><p>The <code class="function">ne_set_addrlist</code> function
forces use of an address and port the a specified list when
establishing a TCP connection, ignoring the "real" hostname
and port identifying the origin server for the session (as
passed to <code class="function">ne_session_create</code>). The
origin server's "real" hostname and port will still be used
in the <code class="literal">Host</code> header in HTTP requests.
When a connection is required, the library will iterate
through the <code class="parameter">addrlist</code> list, attempting
to connect to the address <code class="parameter">addrlist[0]</code>
through to <code class="parameter">addrlist[count-1]</code> in turn,
until a connection can be established.</p></div></div><div class="refsect1"><a name="idm140368850371872"></a><h2>Return Values</h2><p>None of the functions described here has a return
value.</p></div><div class="refsect1"><a name="idm140368850370640"></a><h2>Examples</h2><p>Create and destroy a session:</p><pre class="programlisting">ne_session *sess;
sess = ne_session_create("http", "host.example.com", 80);
ne_session_proxy(sess, "proxy.example.com", 3128);
/* ... use sess ... */
ne_session_destroy(sess);
</pre></div><div class="refsect1"><a name="idm140368850368672"></a><h2>See Also</h2><p><a class="xref" href="refsslvfy.html#ne_ssl_set_verify">ne_ssl_set_verify</a>, <a class="xref" href="refsslca.html#ne_ssl_trust_cert">ne_ssl_trust_cert</a>, <a class="xref" href="refsockinit.html#ne_sock_init">ne_sock_init</a>, <a class="xref" href="refsessflags.html#ne_set_session_flag">ne_set_session_flag</a></p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="refsess.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ref.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="refsessflags.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ne_session_create </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> ne_set_session_flag</td></tr></table></div></body></html>
OHA YOOOO