easy:SetOpt_PreReqFunction(prereq_callback[, userdata])
This function may be called multiple times if redirections are enabled and are
being followed (see #CURLOPT_FOLLOWLOCATION).
The function is called like this:
res = prereq(primary_ip, local_ip, primary_port, local_port[, data]) |
Here is a description of all parameters:
primary_iplocal_ipprimary_portlocal_portdatauserdata argument, the value you pass in userdata
will be passed to your callback function as this parameter. The userdata parameter
can be of any type.
The callback function must return #CURL_PREREQFUNC_OK on success, or
#CURL_PREREQFUNC_ABORT to cause the transfer to fail.