QuickCreateProxies
Quickly forwards multiple proxies to the provided ports. If a port has a configured proxy, it will be used; otherwise a random proxy is assigned. You can optionally restrict forwarding to currently unused ports.
int QuickCreateProxies(char* requestId, char* plan, uint32_t* ports, int n, int onlyFree, uint32_t** outPtr, int* outLen)
Parameters
requestId (char*): Correlation ID used to receive success/failure status via events.
plan (char*): Plan ID (default “1”).
ports (uint32_t*): Input array of ports to forward.
n (int): Number of elements in ports.
onlyFree (int): 1 to consider only ports that are not in use; 0 to attempt all provided ports.
outPtr (uint32_t**): Output pointer that will receive a heap-allocated array of successfully forwarded ports. Must be freed with FreeBuf().
outLen (int*): Output count of elements written to outPtr.
Return Value
int: 0 on success; non-zero on error.
NOTE
Action type defaults to "manual" internally; there is no actionType parameter for this function.
If only Free = 1, busy ports are skipped.
Caller must FreeBuf(outPtr) when outPtr is non-NULL.
Example
// example
uint32_t cand[]={60000,60001,60002};
uint32_t* out=NULL; int m=0;
QuickCreateProxies("p","basic",cand,3,1,&out,&m);
if (out){ FreeBuf(out);}
Last updated
Was this helpful?