forked from vadimpronin/guacamole-lite
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathClientExample.jsx
41 lines (34 loc) · 1009 Bytes
/
ClientExample.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import Guacamole from 'guacamole-common-js';
import React from 'react';
import encrypt from './encrypt.js';
class GuacamoleStage extends React.Component {
constructor(props) {
super(props);
this.myRef = React.createRef();
this.token = encrypt({
connection: {
type: 'rdp',
settings: {
hostname: '10.10.10.10', // Replace with IP
username: 'Administrator',
password: 'Password',
'enable-drive': true,
'create-drive-path': true,
security: 'any',
'ignore-cert': true,
'enable-wallpaper': false,
},
},
});
this.tunnel = new Guacamole.WebSocketTunnel('ws://localhost:8080/');
this.client = new Guacamole.Client(this.tunnel);
}
componentDidMount() {
this.myRef.current.appendChild(this.client.getDisplay().getElement());
this.client.connect('token='+this.token);
}
render() {
return <div ref={this.myRef} />;
}
}
export default GuacamoleStage