]>
git.proxmox.com Git - mirror_xterm.js.git/blob - addons/attach/attach.js
e7cac84d7189766c5cf620ce719ec18d654018e1
2 * Implements the attach method, that
3 * attaches the terminal to a WebSocket stream.
5 * The bidirectional argument indicates, whether the terminal should
6 * send data to the socket as well and is true, by default.
10 if (typeof define
== 'function') {
12 * Require.js is available
14 define(['../../src/xterm'], attach
);
17 * Plain browser environment
22 Xterm
.prototype.attach = function (socket
, bidirectional
) {
25 bidirectional
= (typeof bidirectional
== 'undefined') ? true : bidirectional
;
28 socket
.addEventListener('message', function (ev
) {
33 this.on('data', function (data
) {