RealTime View

How to view your session

This HTML sets up a VNC Viewer using the noVNC library, allowing connection to a remote desktop session via WebSockets. For public mode, the base url api.tasknet.co followed by /vnc/sessionUUIID

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>VNC Viewer</title>
    </head>
    <body>
        <div id="main__content">
            <div class="vnc__screen">
                <div id="screen">
                    <!-- This is where the remote screen will appear -->
                </div>
            </div>
        </div>
        <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
        <script src="https://cdn.jsdelivr.net/npm/@hostnet/[email protected]/dist/novnc.min.js"></script>
        <script type="module">
            // Configure your VNC connection details here
            let rfb
            let desktopName
            let sessionUUIID = "<your-session-uuid>"
            const SESSION_URL = "wss://vnc.tasknet.co/sessionUUIID"
            function connectVNC() {
                // Creating a new RFB object will start a new connection
                rfb = new RFB(
                    document.getElementById('screen'), 
                    SESSION_URL,
                    // IF passowrd is required
                    //{ credentials: { password: password } }
                )

                // Set parameters that can be changed on an active connection
                rfb.viewOnly = false
                rfb.scaleViewport = false   
            }

            $(document).ready(() => {
                $("#disconnect__button").on("click", function() {
                    rfb.disconnect()
                })
                // Connect immediately
                connectVNC()
            })
        </script>
    </body>
</html>

Last updated