Enabling web-domain-proxy
Posted: Sat Oct 19, 2013 11:39 pm
I'm trying to add a web domain proxy via the api.
It works fine using the command line:
but when I try this through the API I get an error:
Error: argument extentions is not valid (empty)
It works fine using the command line:
Code: Select all
v-add-web-domain-proxy ted test.test.com
Error: argument extentions is not valid (empty)
Code: Select all
function createWebDomainProxy($server,$admuser,$admpa,$proxyDomain)
{
// Prepare variables
$postvars1 = array(
'user' => $admuser,
'password' => $admpa,
'cmd' => 'v-add-web-domain-proxy',
'arg1' => 'ted',
'arg2' => $proxyDomain
);
$postdata = http_build_query($postvars1);
//echo $postdata;
// Get current status
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://' . $server . ':8083/api/');
curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata);
$answer = curl_exec($curl);
return $answer;
}
$server = '192.0.0.0';
$admuser = 'admin';
$admpa = 'topsecret';
$domain = 'test.test.com'
echo createWebDomainProxy($server,$admuser,$admpa,$domain);