telnet tcp->udp, https->http
This commit is contained in:
@@ -82,13 +82,13 @@
|
||||
overflow: auto;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
#home-hd-title {
|
||||
font-size: 1.1em;
|
||||
padding: 0 0 0 20px;
|
||||
min-width: 150px;
|
||||
font-weight: bold;
|
||||
flex: 0 0 65px;
|
||||
text-align: center;
|
||||
|
||||
24
ui/home.vue
24
ui/home.vue
@@ -20,7 +20,7 @@
|
||||
<template>
|
||||
<div id="home">
|
||||
<header id="home-header">
|
||||
<h1 id="home-hd-title">Sshwifty</h1>
|
||||
<h1 id="home-hd-title">Shemesh Terminal</h1>
|
||||
|
||||
<a id="home-hd-delay" href="javascript:;" @click="showDelayWindow">
|
||||
<span
|
||||
@@ -33,28 +33,6 @@
|
||||
}}</span>
|
||||
</a>
|
||||
|
||||
<a
|
||||
id="home-hd-plus"
|
||||
class="icon icon-plus1"
|
||||
href="javascript:;"
|
||||
:class="{
|
||||
working: connector.inputting,
|
||||
intensify: connector.inputting && !windows.connect,
|
||||
}"
|
||||
@click="showConnectWindow"
|
||||
></a>
|
||||
|
||||
<tabs
|
||||
id="home-hd-tabs"
|
||||
:tab="tab.current"
|
||||
:tabs="tab.tabs"
|
||||
tabs-class="tab1"
|
||||
list-trigger-class="icon icon-more1"
|
||||
@current="switchTab"
|
||||
@retap="retapTab"
|
||||
@list="showTabsWindow"
|
||||
@close="closeTab"
|
||||
></tabs>
|
||||
</header>
|
||||
|
||||
<screens
|
||||
|
||||
@@ -2,14 +2,14 @@ import * as history from "./history.js";
|
||||
import { ECHO_FAILED } from "./socket.js";
|
||||
|
||||
export function build(ctx) {
|
||||
const connectionStatusNotConnected = "Sshwifty is ready to connect";
|
||||
const connectionStatusNotConnected = "Shemesh Terminal is ready to connect";
|
||||
const connectionStatusConnecting =
|
||||
"Connecting to Sshwifty backend server. It should only take " +
|
||||
"Connecting to Shemesh Terminal backend server. It should only take " +
|
||||
"less than a second, or two";
|
||||
const connectionStatusDisconnected =
|
||||
"Sshwifty is disconnected from it's backend server";
|
||||
"Shemesh Terminal is disconnected from it's backend server";
|
||||
const connectionStatusConnected =
|
||||
"Sshwifty is connected to it's backend server, user interface operational";
|
||||
"Shemesh Terminal is connected to it's backend server, user interface operational";
|
||||
const connectionStatusUnmeasurable =
|
||||
"Unable to measure connection delay. The connection maybe very " +
|
||||
"busy or already lost";
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Sshwifty Web SSH Client</title>
|
||||
<title>Shemesh Terminal</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
</head>
|
||||
<body>
|
||||
@@ -28,7 +28,7 @@
|
||||
<div id="landing-message">
|
||||
<div id="landing-message-logo"></div>
|
||||
|
||||
<h1 id="landing-message-title">Loading Sshwifty</h1>
|
||||
<h1 id="landing-message-title">Loading Shemesh Terminal</h1>
|
||||
|
||||
<div id="landing-message-info">
|
||||
<p>
|
||||
@@ -45,9 +45,6 @@
|
||||
Copyright © 2019-2022 Ni Rui <ranqus@gmail.com>
|
||||
</p>
|
||||
<p class="copy">
|
||||
<a href="https://github.com/nirui/sshwifty" target="blank">
|
||||
Source code
|
||||
</a>
|
||||
|
||||
<a href="/sshwifty/assets/DEPENDENCIES.md" target="blank">
|
||||
Third-party
|
||||
|
||||
30
ui/socket.js
30
ui/socket.js
@@ -36,10 +36,10 @@ class Dial {
|
||||
* decrypt socket traffic
|
||||
*
|
||||
*/
|
||||
constructor(address, timeout, privateKey) {
|
||||
constructor(address, timeout) {
|
||||
this.address = address;
|
||||
this.timeout = timeout;
|
||||
this.privateKey = privateKey;
|
||||
// this.privateKey = privateKey;
|
||||
this.keepAliveTicker = null;
|
||||
}
|
||||
|
||||
@@ -205,17 +205,17 @@ class Dial {
|
||||
10 // max 10 buffered requests
|
||||
);
|
||||
|
||||
let senderNonce = crypt.generateNonce();
|
||||
sd.send(senderNonce);
|
||||
// let senderNonce = crypt.generateNonce();
|
||||
// sd.send(senderNonce);
|
||||
|
||||
let receiverNonce = await reader.readN(rd, crypt.GCMNonceSize);
|
||||
// let receiverNonce = await reader.readN(rd, crypt.GCMNonceSize);
|
||||
|
||||
let key = await this.buildKey();
|
||||
// let key = await this.buildKey();
|
||||
|
||||
sdDataConvert = async (rawData) => {
|
||||
let encoded = await crypt.encryptGCM(key, senderNonce, rawData);
|
||||
let encoded = rawData; // await crypt.encryptGCM(key, senderNonce, rawData);
|
||||
|
||||
crypt.increaseNonce(senderNonce);
|
||||
// crypt.increaseNonce(senderNonce);
|
||||
|
||||
let dataToSend = new Uint8Array(encoded.byteLength + 2);
|
||||
|
||||
@@ -236,13 +236,13 @@ class Dial {
|
||||
dSize <<= 8;
|
||||
dSize |= dSizeBytes[1];
|
||||
|
||||
let decoded = await crypt.decryptGCM(
|
||||
key,
|
||||
receiverNonce,
|
||||
await reader.readN(rd, dSize)
|
||||
);
|
||||
// let decoded = await crypt.decryptGCM(
|
||||
// key,
|
||||
// receiverNonce,
|
||||
let decoded = await reader.readN(rd, dSize);
|
||||
// );
|
||||
|
||||
crypt.increaseNonce(receiverNonce);
|
||||
// crypt.increaseNonce(receiverNonce);
|
||||
|
||||
r.feed(
|
||||
new reader.Buffer(new Uint8Array(decoded), () => {}),
|
||||
@@ -276,7 +276,7 @@ export class Socket {
|
||||
* @param {number} echoInterval Echo interval
|
||||
*/
|
||||
constructor(address, privateKey, timeout, echoInterval) {
|
||||
this.dial = new Dial(address, timeout, privateKey);
|
||||
this.dial = new Dial(address, timeout);
|
||||
this.echoInterval = echoInterval;
|
||||
this.streamHandler = null;
|
||||
}
|
||||
|
||||
@@ -180,16 +180,16 @@ class Term {
|
||||
switch (ev.domEvent.key) {
|
||||
case "Enter":
|
||||
ev.domEvent.preventDefault();
|
||||
this.writeStr("\r\n");
|
||||
// this.writeStr("\r\n");
|
||||
break;
|
||||
case "Backspace":
|
||||
ev.domEvent.preventDefault();
|
||||
this.writeStr("\b \b");
|
||||
// this.writeStr("\b \b");
|
||||
break;
|
||||
default:
|
||||
if (printable) {
|
||||
ev.domEvent.preventDefault();
|
||||
this.writeStr(ev.key);
|
||||
// this.writeStr(ev.key);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user