TaskNet
  • Welcome to TaskNet Documentation
  • 🚀Getting Started
    • Authentication
      • API KEY
      • Environments
      • Fingerprints
    • Private Vs Public
    • QuickStart
  • Node Operators
    • Becoming a Node Operator
  • 📕Features
    • Browser Sessions
      • Automation Script Support
      • Automation with API
      • Real-Time View
      • File Downloads, and Uploads
    • User Fingerprints
      • Proxy
      • Chrome Extensions
  • 📚Guides
    • Running Automation Scripts
    • RealTime View
  • reference
    • Typescript SDK
      • NodeJS/Typescript
    • API Reference
      • Sessions
      • Enviornments
      • Fingerprints
      • Extensions
      • Page
      • Operators
  • What's New
    • Changelog
  • Socials
    • X
    • Github
    • Linkedin
    • Discord
Powered by GitBook
On this page
  1. Guides

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/novnc@1.0.0/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>

PreviousRunning Automation ScriptsNextTypescript SDK

Last updated 1 month ago

📚