免费平台CodeSandbox上搭建webssh项目 huashengdun/webssh HAX/WOIDEN同款 | Koyeb | Render | Northflank | Replit

再拿一个容器平台出来, codesandbox.io

搭一个Hax/Woiden同款的webssh项目 huashengdun/webssh


1. 注册 CodeSandbox 账号

略.


2. 创建 App

右上角

输入 python 过滤, 选使用的人最多的, 带 Offical 字样的.

在窗口的下面部分, 点这个按钮新建一个终端窗口

在新建的终端窗口中执行命令 (*注意, 这里就像是Linux终端一样, 不能用Ctrl+C复制 Ctrl+V粘贴)

pip install webssh
wssh --xsrf=False --xheaders=False --origin='*' --debug --delay=6

如果你在使用过程中遇到 "Websocket authentication failed." 报错


就把上面命令中的 --delay=6 开大一点.


3. 使用 huashengdun/webssh

用过Hax/Woiden的朋友应该很熟悉. 界面本身也很直接.


还有一种用法是在url里面带上参数. 参考官方文档.

需要注意密码部分因为涉及到特殊字符, 所以要用base64加密. 你可以找找在线转换的工具, 如: https://codebeautify.org/base64-encode

也可以在本地安装工具, 比如: https://github.com/veler/DevToys

还可以使用我修改后的版本 https://github.com/crazypeace/huashengdun-webssh 自带一个生成SSH link 的按钮.

IP部分, 是可以在参数里带上IPv6的, 没有特殊处理, 也不需要前后的[]

比如:

https://s5n5lx-8888.csb.app/?hostname=215.127.189.82&port=22&username=root&password=STVjcVZUNjJ1V2pjMzRwRzlx
https://ssh-crazypeace.koyeb.app/?hostname=2607:f130:1:f8:ff:ff:6de9:137a&port=22&username=root&password=STVjcVZUNjJ1V2pjMzRwRzlx

注意, Chrome如果显示字体很奇怪的话, 可以开无痕模式禁用掉插件. 也可以干脆换个浏览器, Edge, Firefox 都可以.

具体原因不清楚. 官方issue里有人问, 也提到了开不同的插件, 会影响显示字体. 但是最终没有解决.



========

后记

koyeb平台 fly.io平台 支持IPv6

CodeSandbox 平台不支持SSH登录IPV6的VPS, 如果你有这样的需求, 可以使用 koyeb 平台, fly.io 平台.

启动命令

也许你注意到了在终端窗口执行命令看起来怪怪的.

嗯, 我也是爬了N多官方的issue之后才得到这样的解决方案的. 

不过, 隐隐约约地好像是关掉了一些校验, 猜测是防止滥用的. 如果你是拿来跑比较重要的项目, 推荐你研究清楚再加上这些参数.

在其它平台上设置启动命令

这个webssh项目和前面几个webssh都不一样. 不是加载Docker镜像, 而是加载 Github Repo, 或者创建 Python 环境; 然后设置启动命令.

Koyeb

简单贴一张图吧. 就不写教程了.

需要自己输入的部分是:
crazypeace/huashengdun-webssh

python run.py --xsrf=False --xheaders=False --origin='*' --debug --delay=6
上图中要设置的是 
Port 8888
Protocol HTTP
另外, 注意 Instance 选 Free 的.

render

贴一些创建流程中的图. 就不写教程了.


https://github.com/crazypeace/huashengdun-webssh
python run.py --xsrf=False --xheaders=False --origin='*' --debug --delay=6

northflank

贴一些创建流程中的图. 就不写教程了.

Dockerfile最后一行需要修改一下.
CMD ["python", "run.py", "--xsrf=False --xheaders=False --origin='*' --debug --delay=6"]

replit

贴一些创建流程中的图. 就不写教程了.

Github URL 输入
https://github.com/crazypeace/huashengdun-webssh
定义运行命令
python run.py --xsrf=False --xheaders=False --origin='*' --debug --delay=6

========
update


部署到Hugging Face的教程 / 作者 Xiang xjfkkk  

部署到 Serv00 教程 / 作者 Xiang xjfkkk  

评论

  1. 部署到Hugging Face的教程 / 作者 Xiang xjfkkk
    https://linux.do/t/topic/135264

    部署到 Serv00 教程 / 作者 Xiang xjfkkk
    https://linux.do/t/topic/211113

    回复删除
  2. fly.io 搭建教程
    https://zelikk.blogspot.com/2023/10/github-codespaces-flyio-webssh.html

    回复删除
  3. Hello, how to change from the port, 8888, to 8080.Because, what you know is port being proxied on ClouldFlare is 8080 or 80. So. can you teach me how to change WebSSH working port on run.claw.cloud. Thank you, I will await at there, if you have a time, please send a email to the mailbox, "MallocPointer@51479.xyz". Both Chinese amd English are acceptable.

    回复删除
    回复
    1. Hi, Thanks for your feedback! I think the easiest way is running a Caddy (or Nignx) to reverseproxy. Use Caddy (or Nginx) listen 8080 then reverseproxy to 8888 which is listen by the webssh.

      删除
    2. Oh, run.claw.cloud you mean a docker service platform. Actually, when you run docker, you can set a different out port. For example, 8080 as the out port on the docker host. And the docker platform can link the 8080 of host to 8888 of your docker entity.

      删除
    3. Here is a similar webssh. https://github.com/cmliu/webssh
      It has a "run on claw cloud" button.
      This is the support group.
      https://t.me/CMLiussss

      删除
    4. Thank you, I have done what I want. Thank you for your help.

      删除

发表评论

The Hot3 in Last 30 Days

Mihomo (Clash-meta) 择优录取 url-test 自动选择能用的端口和协议

Mihomo (Clash-meta) 故障转移 fallback 自动选择能用的端口

搭 Docker版 Sub-Store 带 http-meta 实现 集合订阅 测延迟 排序 筛选 生成新订阅 定时任务上传Gist