✅ Finished up (so far)!
This commit is contained in:
parent
0bf0b9d0a5
commit
803f76ac05
35
index.html
35
index.html
@ -6,25 +6,40 @@
|
|||||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||||
<title>webssh_plus</title>
|
<title>webssh_plus</title>
|
||||||
<script src="/socket.io/socket.io.js"></script>
|
<script src="/socket.io/socket.io.js"></script>
|
||||||
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.terminal {
|
||||||
|
font-family: monospace;
|
||||||
|
color: white;
|
||||||
|
background: black;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<div class="terminal">
|
||||||
|
<!-- ! Here will be the terminal stuff -->
|
||||||
|
</div>
|
||||||
<script>
|
<script>
|
||||||
// Connect to the socket.io server
|
// Connect to the socket.io server
|
||||||
var socket = io.connect('http://localhost:8080');
|
var socket = io.connect('http://localhost:9774');
|
||||||
// Wait for data from the server
|
// Wait for data from the server
|
||||||
socket.on('output', function (data) {
|
socket.on('output', function (data) {
|
||||||
// Insert some line breaks where they belong
|
// Insert some line breaks where they belong
|
||||||
data = data.replace("n", "");
|
data = data.replace("n", "");
|
||||||
data = data.replace("r", "");
|
data = data.replace("r", "");
|
||||||
// Append the data to our terminal
|
// Append the data to our terminal
|
||||||
$('.terminal').append(data);
|
$('.terminal').append(data);
|
||||||
});
|
});
|
||||||
// Listen for user input and pass it to the server
|
// Listen for user input and pass it to the server
|
||||||
$(document).on("keypress",function(e){
|
$(document).on("keypress",function(e){
|
||||||
var char = String.fromCharCode(e.which);
|
var char = String.fromCharCode(e.which);
|
||||||
socket.emit("input", char);
|
socket.emit("input", char);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
Loading…
Reference in New Issue
Block a user