PutConfigPort

Apply a JSON “configure port” payload to a single port.

GoUint8 PutConfigPort(GoUint32 port, char* jsonInfo, GoInt jsonInfoLen)

Parameters

  • port: Target port.

  • jsonInfo: JSON buffer describing the configuration.

  • jsonInfoLen: Length of jsonInfo in bytes.

Return Value

  • GoUint8: 0 on success.

JSON Structure Format:

// JSON Structure Format

{
  "port": 60000,
  "country": ["US", "CA"],
  "state": "California",
  "city": "San Francisco",
  "zip": "94105",
  "isp": "Comcast",
  "refresh": true,
  "rotation": false
}

Example

// example

const char* j="{\"port\":60000,\"country\":[\"US\"]  }";
GoUint8 ok = PutConfigPort(1080,(char*)j,(GoInt)strlen(j));

Last updated

Was this helpful?