CreateWithConfigure

Forward proxies based on filter.

int CreateWithConfigure(char* requestId, uint32_t* ports, int n, char* filterJson, uint32_t** outPtr, int* outLen)

Parameters

  • requestId: Request ID used to receive success/failure status from events.

  • ports: Array of ports to forward.

  • n: Number of elements in ports.

  • filterJson: JSON string filter with the format:

// JSON format

{
  "plan": "1",
  "city": "Hanoi",
  "country": "VN",
  "state": "HN",
  "isp": "VNPT",
  "zip": "100000",
  "list_type": -1,
  "action": "manual" 
}

NOTE

  • list_type must always be -1 (represents using the proxy list).

  • action defaults to "manual".

  • Fields country, city, state, isp, zip are random if not specified.

Return Value

  • int: 0 if success.

  • outPtr: Array of successfully forwarded ports (must be freed with FreeBuf).

  • outLen: Number of elements in outPtr.

Example

// example

const char* req="{\"country\":\"US\",\"list_type\":-1,\"action\":\"manual\"}";
uint32_t p[]={60000,60001}; uint32_t* out=NULL; int m=0;
CreateWithConfigure("mgr-1", p, 2, (char*)req, &out, &m);
if (out){ FreeBuf(out);}

Last updated

Was this helpful?