I'm currently working on a project and want to implement a web-based terminal in the node-red-dashboard. I've already set up xterm and wetty. The problem I got is my small knowledge about sockets. Currently I'm trying to link wetty with xterm but it wont work.
<link rel="stylesheet" href="/xterm/css/xterm.css" />
<script src="/xterm/lib/xterm.js"></script>
<script src="/xterm-addon-attach/lib/xterm-addon-attach.js"></script>
<div id="terminal"></div>
<script>
const socketio = context.global.get("socket.io");
//const sockett = new nett.Socket('3001');
const socket1 = io("ws://localhost:3001");
var term = new Terminal();
var attachAddon = new AttachAddon(socket1);
term.loadAddon(attachAddon);
term.open(document.getElementById('terminal'));
term.write('Raspberry $ ');
</script>
Wetty is hosted on port 3001 and I want to link it to a node at the same machine. What am I doing wrong?