The domains are the same internal network, but the IPs are different.(pve server:32.99:8006, web server:32.22:4200)
Problem Statement:
- I called the /api2/json/access/ticket endpoint to retrieve the ticket and CSRFPreventionToken values. The ticket was used as a browser cookie, but I’m not sure exactly when the CSRFPreventionToken should be applied. Regardless, I kept both values.
- Next, I called the /api2/json/nodes/${node}/qemu/${vmid}/vncproxy endpoint to obtain the port value and the vncticket required for VNC connections. The request headers included:
- Content-Type: application/x-www-form-urlencoded
- Authorization: PVEAPIToken=root@pam!admin=ceed553a-1938-4119-9d44-5905d29b0ebf
- CSRFPreventionToken: csrfToken
- I then attempted to use the retrieved port and vncticket to establish a WebSocket connection.
- However, the browser returned an error indicating that it could not connect. Upon checking the access.log on the Proxmox VE server, I found the following 401 Unauthorized error:
Key Observations:
- The VNC WebSocket API request failed with a 401 Unauthorized error.
- The vncticket and port values appear to be correct, but there seems to be an issue with the authentication process.
Question:
- Are there any common pitfalls or missing configurations when attempting to connect to Proxmox VE’s VNC WebSocket API?
- What steps should I take to successfully establish the WebSocket connection using the provided vncticket and port values?