npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

guacamole-gateway-client

v0.0.2

Published

Guacamole Gateway Remote Desktop Client Angular 15+ module that implements the guacamole protocol utilizing guacamole-gateway-ts

Downloads

11

Readme

#guacamole-gateway-client

This is a remote desktop Angular 15+ component for connecting to nodejs guacamole-gateway-ts gateway

This is based off a previous work of raytecvision with little tweaks to make it work with guacamole-gateway-ts gateway.

##Code scaffolding Run ng generate component component-name --project remote-desktop to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module --project remote-desktop.

Note: Don't forget to add --project remote-desktop or else it will be added to the default project in your angular.json file.

##Build Run ng build remote-desktop to build the project. The build artifacts will be stored in the dist/ directory.

This diagram describes the architecture of Guacamole and the role of guacamole-gateway-ts in it: Chart

Install

  • npm i guacamole-gateway-client
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RemoteDesktopComponent } from './remote-desktop.component';
import { GuacamoleRemoteDesktopModule } from 'guacamole-gateway-client';

@NgModule({
  declarations: [ RemoteDesktopComponent, ],
  exports: [ RemoteDesktopComponent ],
  imports: [
    CommonModule,
    GuacamoleRemoteDesktopModule,
  ]
})
export class RemoteDesktopModule { }
 <div>
     <guacamole-gateway-client #remoteDesktop [showFileManager]="fileManagerVisible">
     <!-- Toolbar items -->
     <guacamole-gateway-client-toolbar-item *ngIf="rdService.isConnected()" (click)="handleTakeScreenshot()">
       Take screenshot
     </guacamole-gateway-client-toolbar-item>
     <guacamole-gateway-client-toolbar-item *ngIf="rdService.isConnected()" (click)="handleClipboard()">
       Clipboard
     </guacamole-gateway-client-toolbar-item>
     <guacamole-gateway-client-toolbar-item *ngIf="rdService.isConnected()" (click)="toggleFileManager()">
       File Manager
     </guacamole-gateway-client-toolbar-item>
     <guacamole-gateway-client-toolbar-item *ngIf="rdService.isConnected()" (click)="handleDisconnect()">
       Disconnect
     </guacamole-gateway-client-toolbar-item>
     <guacamole-gateway-client-toolbar-item *ngIf="!rdService.isFullScreen() && rdService.isConnected()" (click)="handleEnterFullScreen()">
       Enter full screen
     </guacamole-gateway-client-toolbar-item>
     <guacamole-gateway-client-toolbar-item *ngIf="rdService.isFullScreen() && rdService.isConnected()" (click)="handleExitFullScreen()">
       Exit full screen
     </guacamole-gateway-client-toolbar-item>
 

     <!-- Override connection state messages -->
     <guacamole-gateway-client-connecting-message>
       <div class="guacamole-gateway-client-message-title guacamole-gateway-client-message-title-success">
         CONNECTING TO REMOTE DESKTOP
       </div>
       <div class="guacamole-gateway-client-message-body">
         Attempting to connect to the remote desktop. Waiting for response...
       </div>
     </guacamole-gateway-client-connecting-message>

     <!-- Status bar -->
     <guacamole-gateway-client-status-bar *ngIf="rdService.isConnected()">
       <guacamole-gateway-client-status-bar-item>
         You are currently connected to: <strong>Machine 1</strong>
       </guacamole-gateway-client-status-bar-item>
       <guacamole-gateway-client-status-bar-item>
         <span>Need help? Look at our <a href="#">documentation</a></span>
       </guacamole-gateway-client-status-bar-item>
     </guacamole-gateway-client-status-bar>

     <!-- File Manager -->
     <guacamole-gateway-client-file-manager *ngIf="rdService.isConnected()">
     </guacamole-gateway-client-file-manager>
   </guacamole-gateway-client>
 </div>

import { Component, ViewEncapsulation, Input, OnInit, ViewChild, AfterViewInit } from '@angular/core';
import { Guacamole, GuacamoleRemoteDesktopComponent, RemoteDesktopService, TunnelRestApiService } from 'guacamole-gateway-client';

@Component({
 selector: 'remote-desktop',
 templateUrl: './remote-desktop.component.html',
 encapsulation: ViewEncapsulation.None,
 styleUrls: ['./remote-desktop.component.scss']
})

export class RemoteDesktopComponent implements OnInit, AfterViewInit {
 @ViewChild('remoteDesktop', { static: false }) remoteDesktop: GuacamoleRemoteDesktopComponent;

 public fileManagerVisible: boolean = false;


 constructor(
   public rdService: RemoteDesktopService,
   public tunnelRestApiService: TunnelRestApiService,
 ) { }


 handleDisconnect(): void {
   this.rdService.getClient().disconnect();
 }

 handleEnterFullScreen() {
   this.rdService.setFullScreen(true);
 }

 handleExitFullScreen() {
   this.rdService.setFullScreen(false);
 }

 toggleFileManager() {
   this.fileManagerVisible = !this.fileManagerVisible;
 }



 ngOnInit() {
  const socket = new Guacamole.SocketIOTunnel('', {
       path: "{{your path}}",
       transports: ['websocket'],
       secure: true,
       auth: {{your custom authentication/identification object}})
       }
     });
     this.remoteDesktopService.initialize(socket);
     this.connect();
     this.remoteDesktopService.onReconnect.subscribe(reconnect => this.connect());
 }

 ngAfterViewInit() {
   if (this.remoteDesktop) {
     this.remoteDesktop.toolbarVisible = this.rdService.isConnected();
   }
 }


 connect() {
   //tell the gatway this is a client trying to connect
    this.remoteDesktopService.connect({ type: 'client'});
   if (this.remoteDesktop) {
     this.remoteDesktop.toolbarVisible = this.remoteDesktopService.isConnected();
   }
 }

Associated Components

guacamole-gateway-ts guacamole-common-ts

Apache Guacamole