The code should be like this: var url = "wss://192.168.3.128:9443/vsphere-client/webconsole/authd?vmId=vm-205&vmName=zs999&host=192.168.3.128&sessionTicket=cst-VCT-5241dab7-1e0e-845f-be81-3d...
See more...
The code should be like this: var url = "wss://192.168.3.128:9443/vsphere-client/webconsole/authd?vmId=vm-205&vmName=zs999&host=192.168.3.128&sessionTicket=cst-VCT-5241dab7-1e0e-845f-be81-3d83f5a8b5a4--tp-AF-B5-66-D0-BA-4A-CF-A9-8E-73-50-8B-B1-62-D4-8D-7A-BD-0E-B8";
var wmks = WMKS.createWMKS("wmksContainer", {}).register(
WMKS.CONST.Events.CONNECTION_STATE_CHANGE,
function(event,data){
if(data.state == WMKS.CONST.ConnectionState.CONNECTED)
{
console.log("connection state change : connected");
}
});
wmks.connect(url);
Note: 1) The value of sessionTicket can be acquired by visiting "https://192.168.3.128/mob/?moid=SessionManager&method=acquireCloneTicket" 2) Make sure before opening the html page containing the javascript code above, use your web browser to visit "https://192.168.3.128:9443/vsphere-client/" once and accept the SSL certificate (no need to login vSphere Web Client).
webconsole.html is the web page for displaying VM Web Console by vSphere Web Client. The javascript in webconsole.html will use "wss://vcenter_server_ip:9443/vsphere-client/webconsole/authd?..." ...
See more...
webconsole.html is the web page for displaying VM Web Console by vSphere Web Client. The javascript in webconsole.html will use "wss://vcenter_server_ip:9443/vsphere-client/webconsole/authd?..." to connect to vCenter Server. What error you got in the web browser when connecting "wss://.../authd?..." ?