Llesue 最近的时间轴更新
Llesue

Llesue

V2EX 第 624143 号会员,加入于 2023-04-14 16:40:28 +08:00
Llesue 最近回复了
26 天前
回复了 creeeeezy 创建的主题 问与答 求推荐下载机
直接 pve 安装一个 Debian
远程下载:安装 aria2
远程迅雷:pve 安装一个精简 win11 和迅雷
文件中间件:Debian 安装 filebrowser
局域网共享:Samba 配置
备份:rclone, aliyunpan (GitHub 搜)
玩了一下,英文中文分词都有问题……
该网页无法正常运作
1024code.com 未发送任何数据。
ERR_EMPTY_RESPONSE
@meeop #106 试过了,内容加不到 localstorage 里……
data:text/html;charset=utf-8,<title>小小记事本</title><style>* {margin: 0 auto;box-sizing: border-box;color: gray;outline: none;border-radius: 5px;}</style><script> function copyToClipboard() { var htmlContent = document.documentElement.outerHTML; var tempInput = document.createElement("textarea"); tempInput.style.opacity = 0; tempInput.value = 'data:text/html;charset=utf-8,' +htmlContent; document.body.appendChild(tempInput); tempInput.select(); document.execCommand("copy"); document.body.removeChild(tempInput); alert("已复制"); } </script><body style="background: gainsboro;"><div style="display: flex; flex-direction: column; max-width: 960px;"><div style="display: flex; width: 100%; margin: 5vh 0 1.5vh;"><div style="flex: 1; font-size: 2em; font-weight: 600; padding-left: 16px; white-space: nowrap;" contenteditable>编辑标题✏️</div><button onclick="copyToClipboard()" style="border: 1px solid lightgray; padding: 0 20px; cursor: pointer; font-size: 1em;">复制当前页 dataUrl</button></div><div style="width: 100%; min-height: 50vh; padding: 16px; font-size: 1.2em; border: 1px dashed lightgray; background: whitesmoke; text-align: justify;" contenteditable>编辑这里开始.✏️

会了
@Llesue 不会做那个 dataurl 😂
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>小小记事本</title>
<style>
* {
margin: 0 auto;
box-sizing: border-box;
color: #777777;
outline: none;
}
body {
background: #f5f5f5;
}
.main {
display: flex;
flex-direction: column;
max-width: 960px;
}
.container {
display: flex;
width: 100%;
margin: 5vh 0 1.5vh;
}
.title {
flex: 1;
font-size: 2em;
font-weight: 600;
padding-left: 16px;
white-space: nowrap;
}
.edit {
width: 100%;
min-height: 50vh;
padding: 16px;
font-size: 1.2em;
border: 1px dashed #ccc;
border-radius: 2px;
background: #fff;
}
button {
border: 1px solid #ccc;
padding: 0 20px;
cursor: pointer;
}
</style>
</head>
<body>
<div class="main">
<div class="container">
<div class="title" contenteditable>编辑标题✏️</div>
<button id="btn">复制当前页 dataUrl</button>
</div>
<div class="edit" contenteditable>编辑这里开始.✏️</div>
</div>
<script>
function utf8_to_b64(str) {
return window.btoa(unescape(encodeURIComponent(str)));
}

// function b64_to_utf8(str) {
// return decodeURIComponent(escape(window.atob(str)));
// }

const btn = document.querySelector("#btn");
btn.addEventListener("click", () => {
const htmlContent = document.querySelector("html");
console.log(htmlContent.innerHTML);
const dataUrl = "<html>" + htmlContent.innerHTML + "</html>";
const base64 = utf8_to_b64(dataUrl);
// console.log(base64);

const inputValue = `data:text/html;base64,${base64}`
const input = document.createElement("input");
input.setAttribute("readonly", "readonly");
input.setAttribute("value", inputValue);
document.body.appendChild(input);
input.setSelectionRange(0, 9999);
input.select();
document.execCommand("copy");
document.body.removeChild(input);
alert('地址已复制。')
});
</script>
</body>
</html>
321 天前
回复了 chengshilieren 创建的主题 程序员 我有很多适合程序员做项目的域名
我也有好多奇怪的域名,虽然知道没啥价值,但是就是忍不住要买。给我赚一千就出,要么就自用。
amerifat.com
huuhen.com
nigger.in
shobobs.com
ordosmall.com
334 天前
回复了 Llesue 创建的主题 NGINX Nginx 如何反代 wss 连接?
其实我应该多补充一下:
1 、不是常规端口,是 http 86 ,https 88 。
2 、我用的是 filebrowser , 网页访问各项功能都正常,就是 filebrowser 有个命令行工具可以在网页上使用 shell 命令,这些 shell 命令是通过 websocket 传输的。这个功能无法使用,从浏览器调试看是请求不成功:
```
commands.js:12 WebSocket connection to 'wss://box.hideurl.com:88/api/command/?auth=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImlkIjoyLCJsb2NhbGUiOiJ6aC1jbiIsInZpZXdNb2RlIjoibGlzdCIsInNpbmdsZUNsaWNrIjpmYWxzZSwicGVybSI6eyJhZG1pbiI6dHJ1ZSwiZXhlY3V0ZSI6dHJ1ZSwiY3JlYXRlIjp0cnVlLCJyZW5hbWUiOnRydWUsIm1vZGlmeSI6dHJ1ZSwiZGVsZXRlIjp0cnVlLCJzaGFyZSI6dHJ1ZSwiZG93bmxvYWQiOnRydWV9LCJjb21tYW5kcyI6WyJ3YyIsImRmIiwicHdkIiwibG4iLCJndnNoYXJlIiwiYm94LXVzZyIsImxzIiwidHJlZSIsIm12IiwiY3AiLCJybSIsImNhdCIsInRhaWwiLCJncmVwIiwiY2QiLCJ0bGRyIiwibWtkaXIiLCJkdSIsImZpbmQiLCJjaG93biIsInZuc3RhdCIsIm1hbiIsIndnZXQiLCJyY2xvbmUiLCJpZmNvbmZpZyIsImRhdGUiLCJ3aG9hbWkiLCJuZXRzdGF0Il0sImxvY2tQYXNzd29yZCI6ZmFsc2UsImhpZGVEb3RmaWxlcyI6dHJ1ZSwiZGF0ZUZvcm1hdCI6ZmFsc2V9LCJpc3MiOiJGaWxlIEJyb3dzZXIiLCJleHAiOjE2ODQ1NTYwMjMsImlhdCI6MTY4NDU0ODgyM30.gRQ53CHiiESvt7YZN387h5u6pXrvI6jDwoVBTSW_qxg' failed:
```
3 、我的配置里第一个 location 是 filebrowser 的。第二个 location 是 websocket 的。但是 wss 连接还是不通……
4 、ChatGPT 对此类问题束手无策,会重复无用信息车轱辘话。

### 题外话:
大家可以测试一下问 ChatGPT
```
http://damn.com:86 怎么用 nginx 跳转到 https://damn.com:88
```
ChatGPT 会给你一个错误答案。然后你继续问:
```
你仔细看看你的答案正确吗?
```
ChatGPT 会说:你说的对,我犯了一个错误。正确的配置应该是这样……(把上面错误的代码再发一遍),如果你继续说它的答案不正确,它还会道歉,然后原封不动在给你发一遍刚才的配置……哈哈
334 天前
回复了 Llesue 创建的主题 NGINX Nginx 如何反代 wss 连接?
@as9567585 你要是仔细看我贴出的配置,你会发现,我就是这么配置的。
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2405 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 15ms · UTC 16:11 · PVG 00:11 · LAX 09:11 · JFK 12:11
Developed with CodeLauncher
♥ Do have faith in what you're doing.