Giter VIP home page Giter VIP logo

ttyd's Introduction

backend frontend GitHub Releases Docker Pulls Packaging status GitHub

ttyd - Share your terminal over the web

ttyd is a simple command-line tool for sharing terminal over the web.

screenshot

Features

  • Built on top of libuv and WebGL2 for speed
  • Fully-featured terminal with CJK and IME support
  • ZMODEM (lrzsz) / trzsz file transfer support
  • Sixel image output support (img2sixel / lsix)
  • SSL support based on OpenSSL / Mbed TLS
  • Run any custom command with options
  • Basic authentication support and many other custom options
  • Cross platform: macOS, Linux, FreeBSD/OpenBSD, OpenWrt, Windows

❤ Special thanks to JetBrains for sponsoring the opensource license to this project.

Installation

Install on macOS

  • Install with Homebrew: brew install ttyd
  • Install with MacPorts: sudo port install ttyd

Install on Linux

  • Binary version (recommended): download from the releases page
  • Install with Homebrew : brew install ttyd
  • Install the snap: sudo snap install ttyd --classic
  • Build from source (debian/ubuntu):
    sudo apt-get update
    sudo apt-get install -y build-essential cmake git libjson-c-dev libwebsockets-dev
    git clone https://github.com/tsl0922/ttyd.git
    cd ttyd && mkdir build && cd build
    cmake ..
    make && sudo make install
    You may also need to compile/install libwebsockets from source if the libwebsockets-dev package is outdated.
  • Install on OpenWrt: opkg install ttyd
  • Install on Gentoo: clone the repo and follow the directions here.

Install on Windows

Usage

Command-line Options

USAGE:
    ttyd [options] <command> [<arguments...>]

OPTIONS:
    -p, --port              Port to listen (default: 7681, use `0` for random port)
    -i, --interface         Network interface to bind (eg: eth0), or UNIX domain socket path (eg: /var/run/ttyd.sock)
    -U, --socket-owner      User owner of the UNIX domain socket file, when enabled (eg: user:group)
    -c, --credential        Credential for basic authentication (format: username:password)
    -H, --auth-header       HTTP Header name for auth proxy, this will configure ttyd to let a HTTP reverse proxy handle authentication
    -u, --uid               User id to run with
    -g, --gid               Group id to run with
    -s, --signal            Signal to send to the command when exit it (default: 1, SIGHUP)
    -w, --cwd               Working directory to be set for the child program
    -a, --url-arg           Allow client to send command line arguments in URL (eg: http://localhost:7681?arg=foo&arg=bar)
    -W, --writable          Allow clients to write to the TTY (readonly by default)
    -t, --client-option     Send option to client (format: key=value), repeat to add more options
    -T, --terminal-type     Terminal type to report, default: xterm-256color
    -O, --check-origin      Do not allow websocket connection from different origin
    -m, --max-clients       Maximum clients to support (default: 0, no limit)
    -o, --once              Accept only one client and exit on disconnection
    -q, --exit-no-conn      Exit on all clients disconnection
    -B, --browser           Open terminal with the default system browser
    -I, --index             Custom index.html path
    -b, --base-path         Expected base path for requests coming from a reverse proxy (eg: /mounted/here, max length: 128)
    -P, --ping-interval     Websocket ping interval(sec) (default: 5)
    -6, --ipv6              Enable IPv6 support
    -S, --ssl               Enable SSL
    -C, --ssl-cert          SSL certificate file path
    -K, --ssl-key           SSL key file path
    -A, --ssl-ca            SSL CA file path for client certificate verification
    -d, --debug             Set log level (default: 7)
    -v, --version           Print the version and exit
    -h, --help              Print this text and exit

Read the example usage on the wiki.

Browser Support

Modern browsers, See Browser Support.

Alternatives

ttyd's People

Contributors

adriens avatar bbilas avatar daixiang0 avatar dduportal avatar dependabot-preview[bot] avatar dependabot[bot] avatar dmbasso avatar dohnuts avatar greenkeeper[bot] avatar hosiet avatar ideal avatar kz6fittycent avatar linkiwi avatar lonnywong avatar mikelorant avatar neelchauhan avatar neheb avatar oli4vr avatar oskar456 avatar pataquets avatar peterdavehello avatar r10r avatar santhoshkumard11 avatar santosh0705 avatar sevilen avatar shohey1226 avatar sthen avatar tsl0922 avatar weidideng avatar wikiwang1991 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ttyd's Issues

HTOP显示问题

在Chrome56下显示错位
image
image
image

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

在chrome53下也是同样错位
image
image

在firefox下显示一切正常
image
image

在IE11下也正常
image

brew install failure

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.

single session

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:

  1. Does ttyd support this mode of operation?
  2. If no, is that something you are planning to implement?

Thanks a lot

K

can not use lrzsz

When inputting rz/sz in commandline, terminal will be stuck. Is it possible for author to create a similar function to realize it?

memory corruption in tty_server_new

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?

server-patch.txt

[Feature] Static binary releases

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.

debug flag does not work

neither ttypd --debug bash nor ttyd --debug -- bash work
tested in the ubuntu docker container.

ldomterm - a fork of ttyd using DomTerm rather than xterm.js

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.)

Question in UNIX domain socket support

我在使用此程序时,想选用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

build ok, make error

# 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

choose port to listen

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)?

ttyd version 1.2.1 浏览器多次刷新之后 无法再次链接

ttyd version 1.2.1 浏览器多次刷新之后 无法再次链接,如果刚打开的初期疯狂刷新浏览器tty页面,会导致所有窗口都打不开,然后用其他浏览器也连接不进去,一直转圈。只有结束掉子进程才会恢复

Customizing Webfonts

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.

https://github.com/AGhost-7/nodejs-online

Tags

Would it be possible to provide tags for each releases? That would simplify tracking releases for packagers.

Compile error on ubuntu 14.04

-- 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".

homebrew update before installing

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.

Porting to OpenBSD : length mismatch and invalid return

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.

too many dependencies

https://ruby-china.org/topics/31081

找了一下类似的程序,发现了 Wetty 和 GoTTY,但是 Wetty 需要 node 运行环境, GoTTY 编译后的二进制文件太大,多数路由器的 flash 都比较小,不适合集成到路由器固件里。

image

加上这些依赖,应该比GoTTY不小啊。

Docker packaging: Improve Alpine image

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:

Compile error on Ubuntu 14.04

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

未知错误

qq-20161001115446

连接时出现未知错误。
因为系统目录不可写,要丢在opt运行,不知道是否和这个有关。
系统是mipsel,请问怎么解决问题?

ttyd 使用问题

貌似只能支持简单命令?
ttyd vmstat 是可以的;
但是 ttyd vmstat 1 100 就报错了,
ttyd tail -f test.log 像这样多个参数的命令貌似都是不行的。
请问:不支持多个参数的命令么?

not working on ubuntu 16.04

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

openwrt 15.05错误

我的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

ttyd not compiling on LEDE.

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

ssl without client authentification

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)

Refresh with cache empty after 5 mn

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 ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.