mirror of
https://github.com/zhaojh329/rtty.git
synced 2026-02-27 09:53:17 +08:00
30 lines
625 B
HTML
Executable File
30 lines
625 B
HTML
Executable File
<!doctype html>
|
|
<html>
|
|
<head>
|
|
<link rel="stylesheet" href="/css/xterm.css" />
|
|
<script src="/js/jquery-1.12.4.min.js"></script>
|
|
<script src="/js/xterm.js"></script>
|
|
</head>
|
|
<body>
|
|
<div id="terminal"></div>
|
|
<script>
|
|
|
|
var ws = new WebSocket("ws://" + location.host);
|
|
var term = new Terminal();
|
|
ws.onopen = function() {
|
|
term.open(document.getElementById('terminal'));
|
|
|
|
ws.send("connect 448A5BEC4927");
|
|
|
|
term.on('data', function(data) {
|
|
ws.send(data);
|
|
});
|
|
};
|
|
|
|
ws.onmessage = function (e) {
|
|
term.write(e.data);
|
|
};
|
|
|
|
</script>
|
|
</body>
|
|
</html> |