> For the complete documentation index, see [llms.txt](https://docs.9proxy.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.9proxy.com/developers/sdk/sdk-native-c/functions/quickcreateproxies.md).

# 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.

{% code overflow="wrap" %}

```c
int QuickCreateProxies(char* requestId, char* plan, uint32_t* ports, int n, int onlyFree, uint32_t** outPtr, int* outLen)
```

{% endcode %}

***

## 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.

{% hint style="info" %}

## 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.
  {% endhint %}

## Example

```c
// 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);}

```
