tsl0922 / ttyd Goto Github PK
View Code? Open in Web Editor NEWShare your terminal over the web
Home Page: https://tsl0922.github.io/ttyd
License: MIT License
Share your terminal over the web
Home Page: https://tsl0922.github.io/ttyd
License: MIT License
Is it possible to listen on socket rather than network port?
FYI: I have created a "pseudo-fork" of ttyd which uses DomTerm for the terminal emulator logic (rather than xterm.js). The server application, ldomterm, is basically ttyd, but with lots of changes to serve up DomTerm rather than xterm.js.
You can specify a --browser[=command]
which uses command
to automatically start a client session in a web browser. This option (which is the default if --port
is not specified) implies --port 0 --once
.
If you run ldomterm with no arguments it is equivalent to:
ldomterm --port 0 --once --browser="xdg-open %U" /bin/bash
The sources are on GitHub, with the ldomterm sources in the lws-term
directory. Build it with ./configure --with-libwebsockets && make
DomTerm has many advantages: you can "print" images and embed general HTML; better xterm emulation (fewer vttest failures); optional input editing (a poor man's readline); export to clean HTML; and more.
Feedback welcome - if there are any xterm.js features missing (or I broke a ttyd feature) please let me know. From the website of xterm.js I gather it wins in the areas of CJK and IME.
(This isn't really an "issue", but I didn't know where else to announce this. I couldn't find an email address.)
我在使用此程序时,想选用unix socket,但是使用时报
libwebsockets is not compiled with UNIX domain socket support
我已经在编译时启用Unix support.
git clone https://anonscm.debian.org/git/collab-maint/libwebsockets.git -b debian-v2.0-stable
cd libwebsockets
git fetch
git reset --hard origin/debian-v2.0-stable
sed -i 's/-DLWS_WITH_LIBUV=ON/-DLWS_WITH_LIBUV=ON -DLWS_IPV6=ON -DLWS_UNIX_SOCK=ON -DLWS_WITH_HTTP2=ON/g' debian/rules
dpkg-buildpackage -b -uc -us
Hello,
After fixing compilation ( just a few defines for STAILQ and c99 )
i am trying to run the daemon.
It stays in this state and does not provide content
[2017/03/03 12:52:26:0036] NOTICE: wsi 0xc3e80cef600: TIMEDOUT WAITING on 3 (did hdr 0, ah 0xc3ee9c7d000, wl 0, pfd events 0)
[2017/03/03 12:52:26:0047] NOTICE: lws_header_table_detach: wsi 0xc3e80cef600: ah held 6s, ah.rxpos 0, ah.rxlen 0, mode/state 0 4,wsi->more_rx_waiting 0
i ran it like this :
ttyd -O --debug 7 --index /usr/ports/pobj/ttyd-1.3.0/ttyd-1.3.0/html/index.html /bin/ksh
When the daemon serve small file it s okay, but it looks like the c code forgot to write when
the socket is ready.
curl http://127.0.0.1/ show the html package file is cut :
break;case"m":p="0m";break;default:this._terminal.error("Unknown DCS Pt: %s.",p),p=""}this._terminal.send(s.C0.ESC+"P"+ +f+"$r"+p+s.C0.ESC+"\\");break;case"+p":break;case"+q":p=this._terminal.currentParam,f=!1,this._terminal.send(s.C0.ESC+"P"+ +f+"+r"+p+s.C0.ESC+"\\");break;default:this._terminal.error("Unknown DCS prefix: %s.",this._terminal.prefix)}this._terminal.currentParam=0,
By using nginx/1.10.1 as a proxy see https://www.nginx.com/blog/websocket-nginx/
i can load the all index.html but other error occurs :
WebSocket connection to 'ws://my.com/index.htmlws' failed: Error during WebSocket handshake: Unexpected response code: 502
Because the full referrer of my request is used ( i called with index.html )
By playing arounf with nginx i got something working but the issues should be fixed.
Err http://ppa.launchpad.net jessie/main i386 Packages
404 Not Found
Ign http://ppa.launchpad.net jessie/main Translation-en
Ign http://rpms.litespeedtech.com jessie/main Translation-en
Fetched 10.6 kB in 4s (2471 B/s)
W: Failed to fetch http://ppa.launchpad.net/tsl0922/ttyd-dev/ubuntu/dists/jessie/main/binary-i386/Packages 404 Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
貌似只能支持简单命令?
ttyd vmstat 是可以的;
但是 ttyd vmstat 1 100 就报错了,
ttyd tail -f test.log 像这样多个参数的命令貌似都是不行的。
请问:不支持多个参数的命令么?
sudo apt-get install cmake g++ pkg-config git vim-common libwebsockets-dev libjson-c-dev libssl-dev
git clone https://github.com/tsl0922/ttyd.git
cd ttyd && mkdir build && cd build
cmake ..
make
execute above command and notify fatal error:
In file included from ttyd/src/server.c:1:0:
ttyd/src/server.h:1:24: fatal error: lws_config.h: No such file or directory
#include "lws_config.h"
I already downloaded libwebsockets source code and install to fix this compile error.
Please update README.md
Google Chrome 56.0.2924.87 (正式版本) m (64 位)
修订版本 0e9a9a6f3676ae439b78cd9b3f62b4193c3ac7d5-refs/branch-heads/2924@{#895}
操作系统 Windows
JavaScript V8 5.6.326.50
Flash 24.0.0.221 C:\Users\Administrator\AppData\Local\Google\Chrome\User Data\PepperFlash\24.0.0.221\pepflashplayer.dll
用户代理 Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36
命令行 "C:\Users\Administrator\AppData\Local\Google\Chrome\Application\chrome.exe" --flag-switches-begin --flag-switches-end
ttyd version 1.2.1 浏览器多次刷新之后 无法再次链接,如果刚打开的初期疯狂刷新浏览器tty页面,会导致所有窗口都打不开,然后用其他浏览器也连接不进去,一直转圈。只有结束掉子进程才会恢复
Based on comments on 8433e75 ,
as soon as Alpine Linux 3.6 will be released (https://bugs.alpinelinux.org/versions/115 - 1st of May 2017) , the alpine Docker declination of this image can be improved with the followings:
Seems that algorithm to calculate available lines have some bugs.
This will cause binary package installations to fail.
This can happen if you install osx-gcc-installer or RailsInstaller.
To restore it, you must reinstall OS X or restore the binary from
the OS packages.
==> Installing ttyd from tsl0922/ttyd
==> Installing dependencies for tsl0922/ttyd/ttyd: libwebsockets
==> Installing tsl0922/ttyd/ttyd dependency: libwebsockets
==> Downloading https://homebrew.bintray.com/bottles/libwebsockets-1.4.mavericks
Already downloaded: /Library/Caches/Homebrew/libwebsockets-1.4.mavericks.bottle.tar.gz
==> Pouring libwebsockets-1.4.mavericks.bottle.tar.gz
/usr/bin/install_name_tool: object: /usr/local/Cellar/libwebsockets/1.4/bin/libwebsockets-test-client malformed object (unknown load command 4)
Error: Failure while executing: /usr/bin/install_name_tool -change @@HOMEBREW_PREFIX@@/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/Cellar/libwebsockets/1.4/bin/libwebsockets-test-client
Warning: Bottle installation failed: building from source.
==> Downloading http://git.libwebsockets.org/cgi-bin/cgit/libwebsockets/snapshot
Already downloaded: /Library/Caches/Homebrew/libwebsockets-1.4.tar.gz
Error: SHA256 mismatch
Expected: e11492477e582ef0b1a6ea2f18d81a9619b449170a3a5c43f32a9468461a9798
Actual: d51e6869112054144e3dbcff3c35e9337dbe5b34c3ba9baebecaf6d3e9f7397a
Archive: /Library/Caches/Homebrew/libwebsockets-1.4.tar.gz
To retry an incomplete download, remove the file above.
bumping slowly ? why not 2.8.1 ?
Hi, ttyd won't compile on latest LEDE:
make[3]: Entering directory '/home/dani/LEDE/feeds/packages/utils/ttyd'
CFLAGS="-Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mips16 -minterlink-mips16 -iremap /home/dani/LEDE/build_dir/target-mips_24kc_musl-1.1.15/ttyd-1.0.0:ttyd-1.0.0 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -I/home/dani/LEDE/staging_dir/target-mips_24kc_musl-1.1.15/usr/include -I/home/dani/LEDE/staging_dir/target-mips_24kc_musl-1.1.15/include -I/home/dani/LEDE/staging_dir/toolchain-mips_24kc_gcc-5.4.0_musl-1.1.15/usr/include -I/home/dani/LEDE/staging_dir/toolchain-mips_24kc_gcc-5.4.0_musl-1.1.15/include/fortify -I/home/dani/LEDE/staging_dir/toolchain-mips_24kc_gcc-5.4.0_musl-1.1.15/include " CXXFLAGS="-Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mips16 -minterlink-mips16 -iremap /home/dani/LEDE/build_dir/target-mips_24kc_musl-1.1.15/ttyd-1.0.0:ttyd-1.0.0 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -I/home/dani/LEDE/staging_dir/target-mips_24kc_musl-1.1.15/usr/include -I/home/dani/LEDE/staging_dir/target-mips_24kc_musl-1.1.15/include -I/home/dani/LEDE/staging_dir/toolchain-mips_24kc_gcc-5.4.0_musl-1.1.15/usr/include -I/home/dani/LEDE/staging_dir/toolchain-mips_24kc_gcc-5.4.0_musl-1.1.15/include/fortify -I/home/dani/LEDE/staging_dir/toolchain-mips_24kc_gcc-5.4.0_musl-1.1.15/include " LDFLAGS="-L/home/dani/LEDE/staging_dir/target-mips_24kc_musl-1.1.15/usr/lib -L/home/dani/LEDE/staging_dir/target-mips_24kc_musl-1.1.15/lib -L/home/dani/LEDE/staging_dir/toolchain-mips_24kc_gcc-5.4.0_musl-1.1.15/usr/lib -L/home/dani/LEDE/staging_dir/toolchain-mips_24kc_gcc-5.4.0_musl-1.1.15/lib -znow -zrelro " make -j1 -C /home/dani/LEDE/build_dir/target-mips_24kc_musl-1.1.15/ttyd-1.0.0/. AR="mips-openwrt-linux-musl-gcc-ar" AS="mips-openwrt-linux-musl-gcc -c -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -iremap /home/dani/LEDE/build_dir/target-mips_24kc_musl-1.1.15/ttyd-1.0.0:ttyd-1.0.0 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro" LD=mips-openwrt-linux-musl-ld NM="mips-openwrt-linux-musl-gcc-nm" CC="mips-openwrt-linux-musl-gcc" GCC="mips-openwrt-linux-musl-gcc" CXX="mips-openwrt-linux-musl-g++" RANLIB="mips-openwrt-linux-musl-gcc-ranlib" STRIP=mips-openwrt-linux-musl-strip OBJCOPY=mips-openwrt-linux-musl-objcopy OBJDUMP=mips-openwrt-linux-musl-objdump SIZE=mips-openwrt-linux-musl-size CROSS="mips-openwrt-linux-musl-" ARCH="mips" ;
make[4]: Entering directory '/home/dani/LEDE/build_dir/target-mips_24kc_musl-1.1.15/ttyd-1.0.0'
make[5]: Entering directory '/home/dani/LEDE/build_dir/target-mips_24kc_musl-1.1.15/ttyd-1.0.0'
make[6]: Entering directory '/home/dani/LEDE/build_dir/target-mips_24kc_musl-1.1.15/ttyd-1.0.0'
[ 16%] Generating html.h from index.html
/bin/sh: CMAKE_XXD-NOTFOUND: command not found
make[6]: *** [CMakeFiles/ttyd.dir/build.make:62: html.h] Error 127
make[6]: Leaving directory '/home/dani/LEDE/build_dir/target-mips_24kc_musl-1.1.15/ttyd-1.0.0'
make[5]: *** [CMakeFiles/Makefile2:67: CMakeFiles/ttyd.dir/all] Error 2
make[5]: Leaving directory '/home/dani/LEDE/build_dir/target-mips_24kc_musl-1.1.15/ttyd-1.0.0'
make[4]: *** [Makefile:128: all] Error 2
make[4]: Leaving directory '/home/dani/LEDE/build_dir/target-mips_24kc_musl-1.1.15/ttyd-1.0.0'
make[3]: *** [Makefile:51: /home/dani/LEDE/build_dir/target-mips_24kc_musl-1.1.15/ttyd-1.0.0/.built] Error 2
make[3]: Leaving directory '/home/dani/LEDE/feeds/packages/utils/ttyd'
make[2]: *** [package/Makefile:128: package/feeds/packages/ttyd/compile] Error 2
make[2]: Leaving directory '/home/dani/LEDE'
make[1]: *** [package/Makefile:124: /home/dani/LEDE/staging_dir/target-mips_24kc_musl-1.1.15/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/dani/LEDE'
make: *** [/home/dani/LEDE/include/toplevel.mk:195: world] Error 2
binary in PPA is using an outdated libwebsockets so that setgid
is not called before setuid
and a privilege drop may fail:
https://ruby-china.org/topics/31081
找了一下类似的程序,发现了 Wetty 和 GoTTY,但是 Wetty 需要 node 运行环境, GoTTY 编译后的二进制文件太大,多数路由器的 flash 都比较小,不适合集成到路由器固件里。
加上这些依赖,应该比GoTTY不小啊。
Just build and ran ttyd 1.3.3 on openBSD,
the programs hangs like before my return 0 patch but after a minute
The log always show [2017/07/18 10:16:28:2778] NOTICE: sending SIGHUP (1) to process 78440
Maybe it can be reproduced when emptying cache on other platform ?
Would you like to add more error handling for return values from functions like the following?
hterm cannot handle CJK(Chinese, Japanese, Korean) characters, emojis and IMEs correctly.
There's some works for this: vercel/hyper#214, vercel/hyper#740 , but seems not perfect yet.
I'm considering xterm.js as a replacement.
要是能在最顶部加个工具栏,管理ssh 连接,快速连接到某台服务器的功能,那就太棒了
希望能提供 homebrew 安装方式
By typing exit
, the client should go into a "never connect again" state and should prevent it from reconnecting..
我的openwrt是基于15.05的
原来的libwebsocket的版本低。
我已经升级到1.6.0
但是cmake出错,提示版本不对
s/openwrt/works/openwrt_splctrl_2016-10-09_b21852c/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2 -DCMAKE_PREFIX_PATH=/works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2 -DCMAKE_SKIP_RPATH=TRUE . )
-- The C compiler identification is GNU 4.8.3
-- The CXX compiler identification is GNU 4.8.3
-- Check for working C compiler: /works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c/staging_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/bin/mipsel-openwrt-linux-uclibc-gcc
-- Check for working C compiler: /works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c/staging_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/bin/mipsel-openwrt-linux-uclibc-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c/staging_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/bin/mipsel-openwrt-linux-uclibc-g++
-- Check for working CXX compiler: /works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c/staging_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/bin/mipsel-openwrt-linux-uclibc-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found OpenSSL: /works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/usr/lib/libssl.so;/works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/usr/lib/libcrypto.so (found version "1.0.2j")
-- Found PkgConfig: /works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c/staging_dir/host/bin/pkg-config (found version "0.29")
-- checking for module 'libwebsockets>=1.6'
-- package 'libwebsockets>=1.6' not found
CMake Error at /works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c/staging_dir/host/share/cmake-2.8/Modules/FindPkgConfig.cmake:279 (message):
A required package was not found
Call Stack (most recent call first):
/works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c/staging_dir/host/share/cmake-2.8/Modules/FindPkgConfig.cmake:333 (_pkg_check_modules_internal)
CMakeLists.txt:22 (pkg_check_modules)-- Found LIBWEBSOCKETS: /works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/usr/lib/libwebsockets.so
-- Looking for lws_config.h
-- Looking for lws_config.h - found
-- checking for module 'json-c'
-- found json-c, version 0.12
-- Found JSON-C: /works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/usr/lib/libjson-c.so
-- Configuring incomplete, errors occurred!
See also "/works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/ttyd-e6bea9410c4731b39fe4790030269b1ac45f8dcb/CMakeFiles/CMakeOutput.log".
make[2]: *** [/works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/ttyd-e6bea9410c4731b39fe4790030269b1ac45f8dcb/.configured_yyyynnnnnny] Error 1
make[2]: Leaving directory/works/openwrt/packages/scpackages/utils/ttyd' make[1]: *** [package/feeds/scpack/ttyd/compile] Error 2 make[1]: Leaving directory
/works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c'
make: *** [package/ttyd/compile] 错误 2
屏蔽cmake中的版本限制后
-- Configuring done
-- Generating done
-- Build files have been written to: /works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/ttyd-e6bea9410c4731b39fe4790030269b1ac45f8dcb
rm -f /works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/ttyd-e6bea9410c4731b39fe4790030269b1ac45f8dcb/.configured_*
touch /works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/ttyd-e6bea9410c4731b39fe4790030269b1ac45f8dcb/.configured_yyyynnnnnny
CFLAGS="-Os -pipe -mno-branch-likely -mips32r2 -mtune=24kec -mdsp -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -I/works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/usr/include -I/works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/include -I/works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c/staging_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/usr/include -I/works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c/staging_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/include " CXXFLAGS="-Os -pipe -mno-branch-likely -mips32r2 -mtune=24kec -mdsp -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -I/works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/usr/include -I/works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/include -I/works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c/staging_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/usr/include -I/works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c/staging_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/include " LDFLAGS="-L/works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/usr/lib -L/works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/lib -L/works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c/staging_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/usr/lib -L/works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c/staging_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/lib " make -j1 -C /works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/ttyd-e6bea9410c4731b39fe4790030269b1ac45f8dcb/. AR="mipsel-openwrt-linux-uclibc-gcc-ar" AS="mipsel-openwrt-linux-uclibc-gcc -c -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kec -mdsp -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float" LD=mipsel-openwrt-linux-uclibc-ld NM="mipsel-openwrt-linux-uclibc-gcc-nm" CC="mipsel-openwrt-linux-uclibc-gcc" GCC="mipsel-openwrt-linux-uclibc-gcc" CXX="mipsel-openwrt-linux-uclibc-g++" RANLIB="mipsel-openwrt-linux-uclibc-gcc-ranlib" STRIP=mipsel-openwrt-linux-uclibc-strip OBJCOPY=mipsel-openwrt-linux-uclibc-objcopy OBJDUMP=mipsel-openwrt-linux-uclibc-objdump SIZE=mipsel-openwrt-linux-uclibc-size CROSS="mipsel-openwrt-linux-uclibc-" ARCH="mipsel" ;
make[3]: Entering directory/works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/ttyd-e6bea9410c4731b39fe4790030269b1ac45f8dcb' make[4]: Entering directory
/works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/ttyd-e6bea9410c4731b39fe4790030269b1ac45f8dcb'
make[5]: Entering directory/works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/ttyd-e6bea9410c4731b39fe4790030269b1ac45f8dcb' [ 20%] Generating html.h from index.html Scanning dependencies of target ttyd make[5]: Leaving directory
/works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/ttyd-e6bea9410c4731b39fe4790030269b1ac45f8dcb'
make[5]: Entering directory/works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/ttyd-e6bea9410c4731b39fe4790030269b1ac45f8dcb' [ 40%] Building C object CMakeFiles/ttyd.dir/src/server.c.o /works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/ttyd-e6bea9410c4731b39fe4790030269b1ac45f8dcb/src/server.c:18:32: error: 'lws_extension_callback_pm_deflate' undeclared here (not in a function) {"permessage-deflate", lws_extension_callback_pm_deflate, "permessage-deflate"}, ^ /works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/ttyd-e6bea9410c4731b39fe4790030269b1ac45f8dcb/src/server.c:18:9: warning: initialization makes integer from pointer without a cast [enabled by default] {"permessage-deflate", lws_extension_callback_pm_deflate, "permessage-deflate"}, ^ /works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/ttyd-e6bea9410c4731b39fe4790030269b1ac45f8dcb/src/server.c:18:9: warning: (near initialization for 'extensions[0].per_session_data_size') [enabled by default] /works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/ttyd-e6bea9410c4731b39fe4790030269b1ac45f8dcb/src/server.c:19:9: warning: initialization makes integer from pointer without a cast [enabled by default] {"deflate-frame", lws_extension_callback_pm_deflate, "deflate_frame"}, ^ /works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/ttyd-e6bea9410c4731b39fe4790030269b1ac45f8dcb/src/server.c:19:9: warning: (near initialization for 'extensions[1].per_session_data_size') [enabled by default] /works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/ttyd-e6bea9410c4731b39fe4790030269b1ac45f8dcb/src/server.c:20:9: warning: initialization makes integer from pointer without a cast [enabled by default] {NULL, NULL, NULL} ^ /works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/ttyd-e6bea9410c4731b39fe4790030269b1ac45f8dcb/src/server.c:20:9: warning: (near initialization for 'extensions[2].per_session_data_size') [enabled by default] /works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/ttyd-e6bea9410c4731b39fe4790030269b1ac45f8dcb/src/server.c: In function 'main': /works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/ttyd-e6bea9410c4731b39fe4790030269b1ac45f8dcb/src/server.c:181:9: error: 'struct lws_context_creation_info' has no member named 'timeout_secs' info.timeout_secs = 5; ^ make[5]: *** [CMakeFiles/ttyd.dir/src/server.c.o] Error 1 make[5]: Leaving directory
/works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/ttyd-e6bea9410c4731b39fe4790030269b1ac45f8dcb'
make[4]: *** [CMakeFiles/ttyd.dir/all] Error 2
make[4]: Leaving directory/works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/ttyd-e6bea9410c4731b39fe4790030269b1ac45f8dcb' make[3]: *** [all] Error 2 make[3]: Leaving directory
/works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/ttyd-e6bea9410c4731b39fe4790030269b1ac45f8dcb'
make[2]: *** [/works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/ttyd-e6bea9410c4731b39fe4790030269b1ac45f8dcb/.built] Error 2
make[2]: Leaving directory/works/openwrt/packages/scpackages/utils/ttyd' make[1]: *** [package/feeds/scpack/ttyd/compile] Error 2 make[1]: Leaving directory
/works/openwrt/works/openwrt_splctrl_2016-10-09_b21852c'
make: *** [package/ttyd/compile] 错误 2
Would it be possible to provide tags for each releases? That would simplify tracking releases for packagers.
我看监听端口写死,是否可以配置呢~
We can listen to the port 01023 if we have the root access to run the program, however 11023 ports are "privileged" ports. It may not safe if we listen these ports.
So in the code
if (info.port < 0) {
fprintf(stderr, "ttyd: invalid port: %s\n", optarg);
return -1;
}
Do we need to change the condition if( info.port < 0) to if(info.port < 1024)?
removing the --ssl-ca option as mentioned in the documentation results in
root@e230a8b71c80:/# ttyd --ssl --ssl-cert cert.pem --ssl-key key.pem bash
[1502286096:2844] NOTICE: ttyd 1.3.3 (libwebsockets 1.7.1)
[1502286096:2844] NOTICE: tty configuration:
[1502286096:2844] NOTICE: start command: bash
[1502286096:2844] NOTICE: reconnect timeout: 10s
[1502286096:2844] NOTICE: close signal: SIGHUP (1)
[1502286096:2844] NOTICE: Initial logging level 7
[1502286096:2844] NOTICE: Libwebsockets version: 1.7.1 unknown-build-hash
[1502286096:2844] NOTICE: IPV6 not compiled in
[1502286096:2844] NOTICE: libev support compiled in but disabled
[1502286096:2844] NOTICE: Threads: 1 each 1048576 fds
[1502286096:2874] NOTICE: mem: platform fd map: 8388608 bytes
[1502286096:2875] NOTICE: mem: per-conn: 808 bytes + protocol rx buf
[1502286096:2875] NOTICE: canonical_hostname = e230a8b71c80
[1502286096:2875] NOTICE: Compiled with OpenSSL support
[1502286096:2875] NOTICE: SSL ciphers: 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4:!HMAC_SHA1:!SHA1:!DHE-RSA-AES128-GCM-SHA256:!DHE-RSA-AES128-SHA256:!AES128-GCM-SHA256[1502286096:2875] NOTICE: Using SSL mode
Segmentation fault (core dumped)
Hi,
Thanks for an awesome little software!
I recently came across ttyd after an extensive google search thinking it was exactly what I needed. However, after starting to use it I noticed that the behaviour is slightly different:
ttyd will re-initialise every time a client connects with a web-browser. That means if I use it to run a command, say bash, it means it will create a new bash for every client that connects.
However, what I want is that it shares the same session with every client. Actually, I dont even need multiple clients. I would be happy if it disconnected one when accepting another.
So my questions are:
Thanks a lot
K
The client certificates must be signed by the CA specified on the server.
I found a memory corruption error in DomTerm. This was in code imported from ttyd, which appears to have the same bug: The cmd_len value does not include space for the final nul. Alternatively, you could:
ts->command = xmalloc(cmd_len+1);
The second part of the patch is optional - it just seems strange to use sprintf
there. Is there some reason for it?
# tink @ HOMEBOT in ~/ttyd/build on git:master o [20:50:21]
$ make
[ 20%] Generating html.h from index.html
Scanning dependencies of target ttyd
[ 40%] Building C object CMakeFiles/ttyd.dir/src/server.c.o
/home/tink/ttyd/src/server.c: In function ‘tty_server_new’:
/home/tink/ttyd/src/server.c:93:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
for (int i = 0; i < cmd_argc; i++) {
^
/home/tink/ttyd/src/server.c:93:5: note: use option -std=c99 or -std=gnu99 to compile your code
/home/tink/ttyd/src/server.c:104:14: error: redefinition of ‘i’
for (int i = 0; i < cmd_argc; i++) {
^
/home/tink/ttyd/src/server.c:93:14: note: previous definition of ‘i’ was here
for (int i = 0; i < cmd_argc; i++) {
^
/home/tink/ttyd/src/server.c:104:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
for (int i = 0; i < cmd_argc; i++) {
^
/home/tink/ttyd/src/server.c: In function ‘calc_command_start’:
/home/tink/ttyd/src/server.c:132:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
for (int i = 0; i < argc; i++) {
^
/home/tink/ttyd/src/server.c:144:9: error: ‘for’ loop initial declarations are only allowed in C99 mode
for (int i = 0; i < argc; i++) {
^
/home/tink/ttyd/src/server.c:153:14: error: redefinition of ‘i’
for (int i = 0; i < argc; i++) {
^
/home/tink/ttyd/src/server.c:132:14: note: previous definition of ‘i’ was here
for (int i = 0; i < argc; i++) {
^
/home/tink/ttyd/src/server.c:153:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
for (int i = 0; i < argc; i++) {
^
make[2]: *** [CMakeFiles/ttyd.dir/src/server.c.o] Error 1
make[1]: *** [CMakeFiles/ttyd.dir/all] Error 2
make: *** [all] Error 2
We need to handle fragmented messages, or large input on the web may fails.
Ref: https://github.com/warmcat/libwebsockets/blob/master/README.coding.md
APIs:
How do I stop this? (Even if it is not a bug)
cross-post from openwrt/packages#3271
please use secure defaults if ttyd is started without any configuration
make it work only via https TLS 1.2/1.3, without http and change it so by default it listens only on local-network and only on IPv4 reserved-local addresses. This could be changed later from configuration, but the defaults should not allow access from outside the local network.
When inputting rz/sz in commandline, terminal will be stuck. Is it possible for author to create a similar function to realize it?
I just want to propose to provide static binary releases. There are some use-cases when you only want to share a session once, and currently, I resort to gotty since go produces portable binaries by design. ttyd has better support for unicode from my experience and this is why I would love to use ttyd...
P.S. It might be worth to consider musl libc instead of glibc for static compilation.
First of all, great project. I've been trying to find something like this for a while now.
I'm trying to use this project to create remote development environments. I already have docker images which I can use for development environments, so all I had to do was add ttyd to one of my images.
My issue at the moment is that I'm using customized fonts (for vim airline and powerline) which normally can be set from the terminal's options. I'd just need some way to set the font as well as load webfonts into the client.
p.s.: This is what it looks so far.
We would better to update homebrew before we install ttyd, otherwise we might fail in installing libwebsockets.
This is the error message:
Last 15 lines from /Users/yufangxian/Library/Logs/Homebrew/ttyd/01.cmake:
CMake Error at /usr/local/lib/cmake/libwebsockets/LibwebsocketsConfig.cmake:13 (include):
include could not find load file:
/usr/local/lib/cmake/libwebsockets/LibwebsocketsTargets.cmake
Call Stack (most recent call first):
CMakeLists.txt:9 (find_package)
-- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.29.1")
-- Checking for module 'json-c'
-- Found json-c, version 0.12
-- Found JSON-C: /usr/local/lib/libjson-c.dylib
-- Configuring incomplete, errors occurred!
See also "/tmp/ttyd20160927-84356-bgeecl/ttyd-1.0.0/CMakeFiles/CMakeOutput.log".
After I update homebrew, ttyd can be installed successfully.
installation is fine, but can not open in browser, here is the log
[1474175861:3836] NOTICE: Initial logging level 7
[1474175861:3836] NOTICE: Libwebsockets version: 1.7.1 unknown-build-hash
[1474175861:3836] NOTICE: IPV6 not compiled in
[1474175861:3836] NOTICE: libev support compiled in but disabled
[1474175861:3836] NOTICE: Threads: 1 each 1024 fds
[1474175861:3836] NOTICE: mem: platform fd map: 8192 bytes
[1474175861:3837] NOTICE: mem: per-conn: 808 bytes + protocol rx buf
[1474175861:3837] NOTICE: canonical_hostname = william
[1474175861:3837] NOTICE: Compiled with OpenSSL support
[1474175861:3837] NOTICE: Using non-SSL mode
[1474175861:3851] NOTICE: SSL ECDH curve 'prime256v1'
[1474175861:3852] NOTICE: Listening on port 7681
[1474175861:3852] NOTICE: TTY configuration:
[1474175861:3852] NOTICE: start command: bash
[1474175861:3852] NOTICE: reconnect timeout: 10s
[1474175861:3852] NOTICE: close signal: SIGHUP (1)
[1474175864:1665] ERR: Ran out of header data space
[1474175894:2403] ERR: Ran out of header data space
[1474175954:2516] ERR: Ran out of header data space
^C[1474175997:2703] NOTICE: received signal: SIGINT (2)
[1474175997:2703] NOTICE: lws_context_destroy
-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found OpenSSL: /usr/lib/i386-linux-gnu/libssl.so;/usr/lib/i386-linux-gnu/libcrypto.so (found version "1.0.1f")
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.26")
-- checking for module 'libwebsockets>=1.7.0'
-- package 'libwebsockets>=1.7.0' not found
CMake Error at /usr/share/cmake-2.8/Modules/FindPkgConfig.cmake:283 (message):
A required package was not found
Call Stack (most recent call first):
/usr/share/cmake-2.8/Modules/FindPkgConfig.cmake:337 (_pkg_check_modules_internal)
CMakeLists.txt:23 (pkg_check_modules)
-- Found LIBWEBSOCKETS: /usr/lib/i386-linux-gnu/libwebsockets.so
-- Looking for lws_config.h
-- Looking for lws_config.h - not found
-- checking for module 'json-c'
-- found json-c, version 0.11.99
-- Found JSON-C: /usr/lib/i386-linux-gnu/libjson-c.so
-- Configuring incomplete, errors occurred!
See also "/home/tink/ttyd/build/CMakeFiles/CMakeOutput.log".
See also "/home/tink/ttyd/build/CMakeFiles/CMakeError.log".
neither ttypd --debug bash
nor ttyd --debug -- bash
work
tested in the ubuntu docker container.
I'm getting VM217:1 Uncaught ReferenceError: term_ is not defined
For example:
term_.prefs_.set('pref-name', 'pref-value')
term_.prefs_.set('background-color', '#002B36')
term_.prefs_.set('foreground-color', '#839496')
term_.prefs_.set('font-family', 'Menlo')
term_.prefs_.set('font-size', 12)
term_.prefs_.set('font-smoothing', 'subpixel-antialiased')
It would be better to update the openssl commands in README to conform this change. Otherwise generated certificate will not be accepted by latest Google Chrome.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.