
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
xterm-addon-ssh
Advanced tools
This library sends to the socket server for communication with SSH.
If you want to communicate to SSH directly, use xterm-addon-attach
npm install --save xterm-addon-ssh
import { Terminal } from 'xterm';
import { SshAddon } from 'xterm-addon-ssh';
import * as SockJS from 'sockjs-client';
const sockjs = new SockJS('https://127.0.0.1:8080');
const terminal = new Terminal();
const sshAddon = new SshAddon(sockjs, {
serverUuid: '123e4567-e89b-12d3-a456-426614174000',
header: {
Authorization:
'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c',
},
connectImmediately: true,
});
terminal.loadAddon(sshAddon);
import * as React from 'react';
import { QPXterm } from 'qp-xtermjs';
import { SshAddon, TerminalKeyEvent } from 'xterm-addon-ssh';
import * as SockJS from 'sockjs-client';
const sockjs = new SockJS('https://127.0.0.1:8080');
const Term: React.FC = () => {
const terminalRef = useRef<QPXterm | null>();
const sshAddon = React.useRef(
new SshAddon(sockjs, {
serverUuid: '123e4567-e89b-12d3-a456-426614174000',
header: {
Authorization:
'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c',
},
connectImmediately: true,
onKey: console.log,
}),
).current;
const onDidMount = React.useCallback((terminal: QPXterm) => {
terminalRef.current = terminal;
}, []);
React.useEffect(() => {
const callback = (event: Event | TerminalKeyEvent) => {
console.log(event);
};
sshAddon.addEventListener('connect', callback);
sshAddon.addEventListener('message', callback);
sshAddon.addEventListener('key', callback);
sshAddon.addEventListener('error', callback);
sshAddon.addEventListener('close', callback);
return () => {
sshAddon.removeEventListener('connect', callback);
sshAddon.removeEventListener('message', callback);
sshAddon.removeEventListener('key', callback);
sshAddon.removeEventListener('error', callback);
sshAddon.removeEventListener('close', callback);
};
}, []);
React.useEffect(() => {
return () => {
sshAddon.removeAllListeners();
};
});
return <QPXterm onDidMount={onDidMount} addons={[sshAddon]} />;
};
export default Term;
FAQs
Ssh addon for xterm.js
We found that xterm-addon-ssh demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.