This could also been treated as a JS question even I'm using a lot of VMware terms.
I'm using Websocket to connect to a VM that is hosted by vSphere and is managed by vCloud Director.
By vCloud Director API, I can have the security ticket, which is something similar to cst-xlIs3pP+C/oL/tEgwqvBHv6cBFnTT//VfLNh2kwOjOJItTwfEmVmePhjmJHfV0CisjxqaiQ9AJCNwvfu1zpr1dptvANS9NoIk4TCto7gRsM79R633SS2cIEuvXUAs7KzPoqdjYnSM8BcCttHLz8UbaPPYhjxx1MS2sCfUYovjqtGa9QwkZVBPxrfuPHsJNn3XchTO2h1pm/c/kim2kyu3R3worzcTSZsjGIk+QMWdvfEXc/PNYUGASA0EmP/16IMCltnODY9gQ9ddV0LfXeNKw==-IB8jmkQf1OtvVXZsqoO/cT0Ou93Dx7JlMOTGdQ==--tp-49:4A:E1:31:6B:95:39:AD:47:6D:63:F6:1E:72:F7:D1:B5:65:36:00--
.
So, Websocket url is pretty much like this "wss://10.160.122.169/902;cst-xlIs3pP+C/oL/tEgwqvBHv6cBFnTT//VfLNh2kwOjOJItTwfEmVmePhjmJHfV0CisjxqaiQ9AJCNwvfu1zpr1dptvANS9NoIk4TCto7gRsM79R633SS2cIEuvXUAs7KzPoqdjYnSM8BcCttHLz8UbaPPYhjxx1MS2sCfUYovjqtGa9QwkZVBPxrfuPHsJNn3XchTO2h1pm/c/kim2kyu3R3worzcTSZsjGIk+QMWdvfEXc/PNYUGASA0EmP/16IMCltnODY9gQ9ddV0LfXeNKw==-IB8jmkQf1OtvVXZsqoO/cT0Ou93Dx7JlMOTGdQ==--tp-49:4A:E1:31:6B:95:39:AD:47:6D:63:F6:1E:72:F7:D1:B5:65:36:00--"
in which 902 is the port returned by vCloud Director.
After I created this Websocket, my onopen
function is invoked, does this mean the connection is established? However, after one or two seconds, the websocket onclose
is invoked. Is this saying the server is closing the connection? The event code is 1006...
How can I debug more on this problem?