- getSimCtr(LOCALHOST+simports[index]+"/counter/num_instances", index, function(data, index) {
+ try {
+ if (index == 0) {
+ // Check is simulator are running on http or https - no response assumes http
+ getSimCtr("https",LOCALHOSTSECURE+simports[index]+"/", index, function(data, index) {
+ if (data=="OK") {
+ console.log("Found https simulator - assuming all simulators using https" )
+ sim_http_type="https"
+ SIM_LOCALHOST=LOCALHOSTSECURE
+ } else {
+ console.log("No https simulator found - assuming all simulators using http" )
+ sim_http_type="http"
+ SIM_LOCALHOST=LOCALHOST
+ }
+ });
+
+ }
+ } catch(err) {
+ console.log("No https simulator found - assuming all simulators using http" )
+ sim_http_type="http"
+ SIM_LOCALHOST=LOCALHOST
+ }
+ getSimCtr(sim_http_type, SIM_LOCALHOST+simports[index]+"/counter/num_instances", index, function(data, index) {