概述
Windows安装ttyd(Web Terminal)
- 下载ttyd
- 安装MSYS2
- 安装ttyd
终端对于大家来说都不陌生,操作系统都会携带一个终端,就连日常我们使用IDEA也有Terminal。但是Web Terminal却又是以另一种姿态呈现在人们眼前,通过Web浏览器显示终端,方便又快捷。
由于工作需要在浏览器上显示终端便于输入命令,所以,在网上查找Web Terminal的资料,最后,找到以下的Web Terminal:
- ttyd - (https://github.com/tsl0922/ttyd)通过网络共享您的终端,基于C
1.建立在 Libwebsockets 之上,带有libuv以提高速度
2.基于Xterm.js的全功能终端,支持CJK和 IME
3.图形ZMODEM集成与lrzsz支持
4.基于OpenSSL的 SSL 支持
5.使用选项运行任何自定义命令
6.基本身份验证支持和许多其他自定义选项
7.跨平台:macOS、Linux、FreeBSD/OpenBSD、OpenWrt、Windows - gotty - (https://github.com/yudai/gotty)基于go编写的web终端
- wetty - (https://github.com/butlerx/wetty)通过 HTTP 和 https 的终端。WeTTY 是 ajaxterm 和 anyterm 的替代品,但比它们好得多,因为 WeTTY 使用 xterm.js,它是完全用 JavaScript 编写的终端仿真的完整实现。WeTTY 使用 websockets 而不是 Ajax,因此响应时间更好。
- Secure Shell (Chrome App) - (chrome商店)谷歌插件,提供SSH连接
- XTERM.JS - (https://xtermjs.org/)使用xterm.js的前端web终端组件
经过比较最终选择了ttyd作为本次的web terminal,接下来就是演示如何在windows系统上安装ttyd。
下载ttyd
通过ttyd github链接打开ttyd的github页面,可以看到ttyd是跨平台的。在windows上安装,需要选择Install on Windows选项来到此页面,通过页面的介绍可以看到对于windows1809以上的版本可以使用ttyd-main主分支进行ttyd的安装,反之使用MSYS2+WINPTY(使用ttyd-1.5.2)。
由于我的windows系统版本高于1809,所以,使用了主分支安装,首先下载主分支代码到本地,并进行解压得到解压后的文件夹。
主分支和1.5.2是有点区别的,主分支有/scripts/mingw-build.sh脚本自动构造,只需要把msys2以及gcc,cmake等依赖安装成功就可以了,而1.5.2需要自己一步步去构造,一开始我是使用1.5.2版本去安装ttyd的,由于我对C陌生,所以构造ttyd所需的依赖时很容易出现找不到c库,导致我放弃了使用1.5.2版本,使用main分支构造ttyd。
安装MSYS2
- MSYS2通过链接在MSYS2官网上下载x86_64的.exe安装包。
按照MSYS2官网的步骤完整MSYS2和相应的依赖环境的安装,如果嫌弃网速慢或者下载不成功的可以配置一下国内源:
清华大学开源软件镜像
编辑 “msys2安装目录”/etc/pacman.d/mirrorlist.mingw32 ,在文件开头添加:
Server = https://mirrors.tuna.tsinghua.edu.cn/msys2/mingw/i686
编辑 /etc/pacman.d/mirrorlist.mingw64 ,在文件开头添加:
Server = https://mirrors.tuna.tsinghua.edu.cn/msys2/mingw/x86_64
编辑 /etc/pacman.d/mirrorlist.msys ,在文件开头添加:
Server = https://mirrors.tuna.tsinghua.edu.cn/msys2/msys/$arch
##以下两个我没有配置,个人喜欢可以都配置
编辑 /etc/pacman.d/mirrorlist.ucrt64 ,在文件开头添加:
Server = https://mirrors.tuna.tsinghua.edu.cn/msys2/mingw/ucrt64
编辑 /etc/pacman.d/mirrorlist.clang64 ,在文件开头添加:
Server = https://mirrors.tuna.tsinghua.edu.cn/msys2/mingw/clang64
安装成功你的菜单栏会有一下四个应用:
2. MSYS和MSYS2 MinGW x64的区别可以看https://zhuanlan.zhihu.com/p/266448826,我就不做阐述了。
3. 进入MSYS2的安装目录,鼠标右击mingw64.exe选择以管理员身份运行,如果不以管理员身份运行此应用会导致后面安装ttyd.exe无法写入C:Program Files (x86)目录,导致安装失败的问题。
首先运行命令安装ttyd构造所需要的环境:
pacman -Syu
pacman -S 'make' 'mingw64/mingw-w64-x86_64-gcc' 'mingw64/mingw-w64-x86_64-cmake' 'mingw64/mingw-w64-x86_64-zlib' 'mingw64/mingw-w64-x86_64-libuv' 'mingw64/mingw-w64-x86_64-mbedtls' 'mingw64/mingw-w64-x86_64-json-c'
如果运行的是msys2.exe则需要执行以下命令,用于把mingw64的环境绑定到msys2中(没有的话会导致ttyd构建过程中找不到依赖)
export PATH=$PATH:/mingw64/bin/
安装ttyd
- 依赖安装成功,进入ttyd-main目录,只需要进入到ttyd-main根目录就可以了,不要进入到./scripts/目录下运行./mingw-build.sh,这样会导致最后找不到CMakeLists.txt文件。
运行mingw-build.sh脚本安装ttyd:
admin@DESKTOP-JC9JQ4R MINGW64 /d/projects/ttyd-main
# ./scripts/mingw-build.sh
/tmp/libwebsockets-4.3.2 /d/projects/ttyd-main
-- The C compiler identification is GNU 12.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: D:/projects/msys2/mingw64/bin/cc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Compiled with LWS_WITH_DIR and LWS_WITH_LEJP_CONF
SMD requires pthreads
-- Could NOT find Git (missing: GIT_EXECUTABLE)
-- Performing Test LWS_HAVE_inline
-- Performing Test LWS_HAVE_inline - Success
-- Performing Test LWS_HAVE___inline__
-- Performing Test LWS_HAVE___inline__ - Success
-- Performing Test LWS_HAVE___inline
-- Performing Test LWS_HAVE___inline - Success
-- Performing Test LWS_HAVE_MALLOC_TRIM
-- Performing Test LWS_HAVE_MALLOC_TRIM - Failed
-- Performing Test LWS_HAVE_MALLOC_USABLE_SIZE
-- Performing Test LWS_HAVE_MALLOC_USABLE_SIZE - Failed
-- Looking for fork
-- Looking for fork - not found
-- Looking for getenv
-- Looking for getenv - found
-- Looking for malloc
-- Looking for malloc - found
-- Looking for memset
-- Looking for memset - found
-- Looking for realloc
-- Looking for realloc - found
-- Looking for socket
-- Looking for socket - not found
-- Looking for strerror
-- Looking for strerror - found
-- Looking for vfork
-- Looking for vfork - not found
-- Looking for execvpe
-- Looking for execvpe - found
-- Looking for getifaddrs
-- Looking for getifaddrs - not found
-- Looking for snprintf
-- Looking for snprintf - found
-- Looking for _snprintf
-- Looking for _snprintf - found
-- Looking for _vsnprintf
-- Looking for _vsnprintf - found
-- Looking for getloadavg
-- Looking for getloadavg - not found
-- Looking for atoll
-- Looking for atoll - found
-- Looking for _atoi64
-- Looking for _atoi64 - found
-- Looking for _stat32i64
-- Looking for _stat32i64 - not found
-- Looking for clock_gettime
-- Looking for clock_gettime - found
-- Looking for localtime_r
-- Looking for localtime_r - not found
-- Looking for gmtime_r
-- Looking for gmtime_r - not found
-- Looking for ctime_r
-- Looking for ctime_r - not found
-- Looking for getgrgid_r
-- Looking for getgrgid_r - not found
-- Looking for getgrnam_r
-- Looking for getgrnam_r - not found
-- Looking for getpwuid_r
-- Looking for getpwuid_r - not found
-- Looking for getpwnam_r
-- Looking for getpwnam_r - not found
-- Looking for timegm
-- Looking for timegm - not found
-- Looking for in6addr.h
-- Looking for in6addr.h - found
-- Looking for memory.h
-- Looking for memory.h - found
-- Looking for netinet/in.h
-- Looking for netinet/in.h - not found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stdlib.h
-- Looking for stdlib.h - found
-- Looking for strings.h
-- Looking for strings.h - found
-- Looking for string.h
-- Looking for string.h - found
-- Looking for sys/prctl.h
-- Looking for sys/prctl.h - not found
-- Looking for sys/socket.h
-- Looking for sys/socket.h - not found
-- Looking for sys/sockio.h
-- Looking for sys/sockio.h - not found
-- Looking for sys/stat.h
-- Looking for sys/stat.h - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Looking for vfork.h
-- Looking for vfork.h - not found
-- Looking for sys/capability.h
-- Looking for sys/capability.h - not found
-- Looking for malloc.h
-- Looking for malloc.h - found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for inttypes.h
-- Looking for inttypes.h - found
-- Looking for sys/resource.h
-- Looking for sys/resource.h - not found
-- Performing Test LWS_HAVE_WIN32_AFUNIX_H
-- Performing Test LWS_HAVE_WIN32_AFUNIX_H - Success
-- Looking for cap_set_flag in cap
-- Looking for cap_set_flag in cap - not found
-- Looking for 3 include files stdlib.h, ..., string.h
-- Looking for 3 include files stdlib.h, ..., string.h - found
-- Performing Test LWS_HAS_INTPTR_T
-- Performing Test LWS_HAS_INTPTR_T - Success
-- Performing Test LWS_HAS_PTHREAD_SETNAME_NP
-- Performing Test LWS_HAS_PTHREAD_SETNAME_NP - Success
-- Performing Test LWS_HAS_GETOPT_LONG
-- Performing Test LWS_HAS_GETOPT_LONG - Success
-- Performing Test LWS_HAVE_RTA_PREF
-- Performing Test LWS_HAVE_RTA_PREF - Failed
-- Performing Test LWS_HAVE_SUSECONDS_T
-- Performing Test LWS_HAVE_SUSECONDS_T - Failed
-- Performing Test LWS_HAVE_VISIBILITY
-- Performing Test LWS_HAVE_VISIBILITY - Success
-- Performing Test LWS_GCC_HAS_IGNORED_QUALIFIERS
-- Performing Test LWS_GCC_HAS_IGNORED_QUALIFIERS - Success
-- Performing Test LWS_GCC_HAS_TYPE_LIMITS
-- Performing Test LWS_GCC_HAS_TYPE_LIMITS - Success
-- Performing Test LWS_GCC_HAS_NO_DEPRECATED_DECLARATIONS
-- Performing Test LWS_GCC_HAS_NO_DEPRECATED_DECLARATIONS - Success
-- Performing Test LWS_HAVE_PIPE2
-- Performing Test LWS_HAVE_PIPE2 - Failed
-- Performing Test LWS_HAVE_TCP_USER_TIMEOUT
-- Performing Test LWS_HAVE_TCP_USER_TIMEOUT - Failed
-- Found MBEDTLS: D:/projects/msys2/mingw64/include
-- Performing Test LWS_HAVE_MBEDTLS_NET_SOCKETS
-- Performing Test LWS_HAVE_MBEDTLS_NET_SOCKETS - Success
Compiling with SSL support
MBEDTLS include dir: D:/projects/msys2/mingw64/include
MBEDTLS libraries: D:/projects/msys2/mingw64/lib/libmbedtls.dll.a;D:/projects/msys2/mingw64/lib/libmbedx509.dll.a;D:/projects/msys2/mingw64/lib/libmbedcrypto.dll.a
-- Looking for SSL_CTX_set1_param
-- Looking for SSL_CTX_set1_param - not found
-- Looking for SSL_set_info_callback
-- Looking for SSL_set_info_callback - not found
-- Looking for X509_VERIFY_PARAM_set1_host
-- Looking for X509_VERIFY_PARAM_set1_host - not found
-- Looking for X509_VERIFY_PARAM_set1_host
-- Looking for X509_VERIFY_PARAM_set1_host - not found
-- Looking for RSA_set0_key
-- Looking for RSA_set0_key - not found
-- Looking for X509_get_key_usage
-- Looking for X509_get_key_usage - not found
-- Looking for SSL_CTX_EVP_PKEY_new_raw_private_key
-- Looking for SSL_CTX_EVP_PKEY_new_raw_private_key - not found
-- Looking for SSL_CTX_get0_certificate
-- Looking for SSL_CTX_get0_certificate - not found
-- Looking for SSL_get0_alpn_selected
-- Looking for SSL_get0_alpn_selected - not found
-- Looking for SSL_set_alpn_protos
-- Looking for SSL_set_alpn_protos - not found
-- Looking for EVP_aes_128_cfb8
-- Looking for EVP_aes_128_cfb8 - not found
-- Looking for EVP_aes_128_cfb128
-- Looking for EVP_aes_128_cfb128 - not found
-- Looking for EVP_aes_192_cfb8
-- Looking for EVP_aes_192_cfb8 - not found
-- Looking for EVP_aes_192_cfb128
-- Looking for EVP_aes_192_cfb128 - not found
-- Looking for EVP_aes_256_cfb8
-- Looking for EVP_aes_256_cfb8 - not found
-- Looking for EVP_aes_256_cfb128
-- Looking for EVP_aes_256_cfb128 - not found
-- Looking for EVP_aes_128_xts
-- Looking for EVP_aes_128_xts - not found
-- Looking for EVP_aes_128_ofb
-- Looking for EVP_aes_128_ofb - not found
-- Looking for EVP_aes_128_ecb
-- Looking for EVP_aes_128_ecb - not found
-- Looking for EVP_aes_128_ctr
-- Looking for EVP_aes_128_ctr - not found
-- Looking for RSA_verify_pss_mgf1
-- Looking for RSA_verify_pss_mgf1 - not found
-- Looking for HMAC_CTX_new
-- Looking for HMAC_CTX_new - not found
-- Looking for EVP_PKEY_new_raw_private_key
-- Looking for EVP_PKEY_new_raw_private_key - not found
-- Looking for SSL_SESSION_set_time
-- Looking for SSL_SESSION_set_time - not found
-- Looking for EC_KEY_new_by_curve_name
-- Looking for EC_KEY_new_by_curve_name - not found
-- Performing Test LWS_HAVE_MBEDTLS_AUTH_KEY_ID
-- Performing Test LWS_HAVE_MBEDTLS_AUTH_KEY_ID - Failed
-- Performing Test LWS_HAVE_mbedtls_ssl_set_verify
-- Performing Test LWS_HAVE_mbedtls_ssl_set_verify - Success
-- Looking for mbedtls_ssl_get_alpn_protocol
-- Looking for mbedtls_ssl_get_alpn_protocol - found
-- Looking for mbedtls_ssl_conf_sni
-- Looking for mbedtls_ssl_conf_sni - found
-- Looking for mbedtls_ssl_set_hs_ca_chain
-- Looking for mbedtls_ssl_set_hs_ca_chain - found
-- Looking for mbedtls_ssl_set_hs_own_cert
-- Looking for mbedtls_ssl_set_hs_own_cert - found
-- Looking for mbedtls_ssl_set_hs_authmode
-- Looking for mbedtls_ssl_set_hs_authmode - found
-- Looking for mbedtls_net_init
-- Looking for mbedtls_net_init - found
-- Looking for mbedtls_x509_crt_parse_file
-- Looking for mbedtls_x509_crt_parse_file - found
-- Looking for mbedtls_md_setup
-- Looking for mbedtls_md_setup - found
-- Looking for mbedtls_rsa_complete
-- Looking for mbedtls_rsa_complete - found
-- Looking for mbedtls_internal_aes_encrypt
-- Looking for mbedtls_internal_aes_encrypt - found
Searching for OpenSSL executable and dlls
GENCERTS = 0
libuv include dir: D:/projects/msys2/mingw64/include
libuv libraries: D:/projects/msys2/mingw64/lib/libuv.dll.a
-- Looking for uv-version.h
-- Looking for uv-version.h - not found
-- Looking for uv/version.h
-- Looking for uv/version.h - found
DIR D:/projects/msys2/tmp/libwebsockets-4.3.2/build CMP D:/projects/msys2/tmp/libwebsockets-4.3.2/cmake
-- Configuring done
-- Generating done
-- Build files have been written to: D:/projects/msys2/tmp/libwebsockets-4.3.2/build
[ 0%] Creating build include dir
[ 0%] Built target GENHDR
Scanning dependencies of target websockets_shared
[ 1%] Building C object lib/CMakeFiles/websockets.dir/plat/windows/windows-fds.c.obj
[ 1%] Building C object lib/CMakeFiles/websockets.dir/plat/windows/windows-file.c.obj
[ 2%] Building C object lib/CMakeFiles/websockets.dir/plat/windows/windows-init.c.obj
[ 2%] Building C object lib/CMakeFiles/websockets.dir/plat/windows/windows-misc.c.obj
[ 2%] Building C object lib/CMakeFiles/websockets_shared.dir/plat/windows/windows-fds.c.obj
[ 4%] Building C object lib/CMakeFiles/websockets_shared.dir/plat/windows/windows-file.c.obj
[ 4%] Building C object lib/CMakeFiles/websockets.dir/plat/windows/windows-pipe.c.obj
[ 4%] Building C object lib/CMakeFiles/websockets_shared.dir/plat/windows/windows-init.c.obj
[ 4%] Building C object lib/CMakeFiles/websockets.dir/plat/windows/windows-plugins.c.obj
[ 4%] Building C object lib/CMakeFiles/websockets_shared.dir/plat/windows/windows-pipe.c.obj
[ 5%] Building C object lib/CMakeFiles/websockets.dir/plat/windows/windows-service.c.obj
[ 7%] Building C object lib/CMakeFiles/websockets_shared.dir/plat/windows/windows-plugins.c.obj
[ 7%] Building C object lib/CMakeFiles/websockets_shared.dir/plat/windows/windows-service.c.obj
[ 7%] Building C object lib/CMakeFiles/websockets_shared.dir/plat/windows/windows-misc.c.obj
[ 7%] Building C object lib/CMakeFiles/websockets.dir/plat/windows/windows-sockets.c.obj
[ 8%] Building C object lib/CMakeFiles/websockets_shared.dir/plat/windows/windows-sockets.c.obj
[ 8%] Building C object lib/CMakeFiles/websockets_shared.dir/__/win32port/win32helpers/gettimeofday.c.obj
[ 9%] Building C object lib/CMakeFiles/websockets.dir/__/win32port/win32helpers/gettimeofday.c.obj
[ 9%] Building C object lib/CMakeFiles/websockets.dir/tls/mbedtls/wrapper/library/ssl_cert.c.obj
[ 10%] Building C object lib/CMakeFiles/websockets_shared.dir/tls/mbedtls/wrapper/library/ssl_cert.c.obj
[ 11%] Building C object lib/CMakeFiles/websockets.dir/tls/mbedtls/wrapper/library/ssl_lib.c.obj
[ 11%] Building C object lib/CMakeFiles/websockets_shared.dir/tls/mbedtls/wrapper/library/ssl_lib.c.obj
[ 12%] Building C object lib/CMakeFiles/websockets.dir/tls/mbedtls/wrapper/library/ssl_methods.c.obj
[ 13%] Building C object lib/CMakeFiles/websockets_shared.dir/tls/mbedtls/wrapper/library/ssl_methods.c.obj
[ 14%] Building C object lib/CMakeFiles/websockets_shared.dir/tls/mbedtls/wrapper/library/ssl_pkey.c.obj
[ 14%] Building C object lib/CMakeFiles/websockets_shared.dir/tls/mbedtls/wrapper/library/ssl_stack.c.obj
[ 15%] Building C object lib/CMakeFiles/websockets.dir/tls/mbedtls/wrapper/library/ssl_stack.c.obj
[ 15%] Building C object lib/CMakeFiles/websockets.dir/tls/mbedtls/wrapper/library/ssl_pkey.c.obj
[ 16%] Building C object lib/CMakeFiles/websockets_shared.dir/tls/mbedtls/wrapper/library/ssl_x509.c.obj
[ 16%] Building C object lib/CMakeFiles/websockets.dir/tls/mbedtls/wrapper/library/ssl_x509.c.obj
[ 16%] Building C object lib/CMakeFiles/websockets_shared.dir/tls/mbedtls/wrapper/platform/ssl_pm.c.obj
[ 17%] Building C object lib/CMakeFiles/websockets.dir/tls/mbedtls/wrapper/platform/ssl_pm.c.obj
[ 18%] Building C object lib/CMakeFiles/websockets_shared.dir/tls/mbedtls/wrapper/platform/ssl_port.c.obj
[ 18%] Building C object lib/CMakeFiles/websockets.dir/tls/mbedtls/wrapper/platform/ssl_port.c.obj
[ 18%] Building C object lib/CMakeFiles/websockets_shared.dir/tls/tls.c.obj
[ 19%] Building C object lib/CMakeFiles/websockets.dir/tls/tls.c.obj
[ 20%] Building C object lib/CMakeFiles/websockets_shared.dir/tls/tls-network.c.obj
[ 20%] Building C object lib/CMakeFiles/websockets.dir/tls/tls-network.c.obj
[ 21%] Building C object lib/CMakeFiles/websockets.dir/tls/tls-sessions.c.obj
[ 22%] Building C object lib/CMakeFiles/websockets_shared.dir/tls/mbedtls/mbedtls-tls.c.obj
[ 22%] Building C object lib/CMakeFiles/websockets_shared.dir/tls/tls-sessions.c.obj
[ 22%] Building C object lib/CMakeFiles/websockets_shared.dir/tls/mbedtls/mbedtls-extensions.c.obj
[ 23%] Building C object lib/CMakeFiles/websockets_shared.dir/tls/mbedtls/mbedtls-x509.c.obj
[ 23%] Building C object lib/CMakeFiles/websockets.dir/tls/mbedtls/mbedtls-tls.c.obj
[ 24%] Building C object lib/CMakeFiles/websockets_shared.dir/tls/mbedtls/mbedtls-ssl.c.obj
[ 25%] Building C object lib/CMakeFiles/websockets.dir/tls/mbedtls/mbedtls-extensions.c.obj
[ 25%] Building C object lib/CMakeFiles/websockets_shared.dir/tls/mbedtls/mbedtls-session.c.obj
[ 26%] Building C object lib/CMakeFiles/websockets_shared.dir/tls/tls-server.c.obj
[ 26%] Building C object lib/CMakeFiles/websockets_shared.dir/tls/mbedtls/mbedtls-server.c.obj
[ 27%] Building C object lib/CMakeFiles/websockets.dir/tls/mbedtls/mbedtls-x509.c.obj
[ 28%] Building C object lib/CMakeFiles/websockets_shared.dir/tls/tls-client.c.obj
[ 28%] Building C object lib/CMakeFiles/websockets.dir/tls/mbedtls/mbedtls-ssl.c.obj
[ 28%] Building C object lib/CMakeFiles/websockets_shared.dir/tls/mbedtls/mbedtls-client.c.obj
[ 29%] Building C object lib/CMakeFiles/websockets.dir/tls/mbedtls/mbedtls-session.c.obj
[ 29%] Building C object lib/CMakeFiles/websockets.dir/tls/tls-server.c.obj
[ 30%] Building C object lib/CMakeFiles/websockets_shared.dir/core/alloc.c.obj
[ 30%] Building C object lib/CMakeFiles/websockets_shared.dir/core/buflist.c.obj
[ 31%] Building C object lib/CMakeFiles/websockets_shared.dir/core/context.c.obj
[ 32%] Building C object lib/CMakeFiles/websockets.dir/tls/mbedtls/mbedtls-server.c.obj
[ 32%] Building C object lib/CMakeFiles/websockets_shared.dir/core/lws_dll2.c.obj
[ 33%] Building C object lib/CMakeFiles/websockets_shared.dir/core/lws_map.c.obj
[ 34%] Building C object lib/CMakeFiles/websockets_shared.dir/core/libwebsockets.c.obj
[ 34%] Building C object lib/CMakeFiles/websockets_shared.dir/core/logs.c.obj
[ 35%] Building C object lib/CMakeFiles/websockets_shared.dir/core/vfs.c.obj
[ 35%] Building C object lib/CMakeFiles/websockets.dir/tls/tls-client.c.obj
[ 36%] Building C object lib/CMakeFiles/websockets.dir/tls/mbedtls/mbedtls-client.c.obj
[ 36%] Building C object lib/CMakeFiles/websockets_shared.dir/misc/base64-decode.c.obj
[ 36%] Building C object lib/CMakeFiles/websockets.dir/core/alloc.c.obj
[ 37%] Building C object lib/CMakeFiles/websockets.dir/core/buflist.c.obj
[ 38%] Building C object lib/CMakeFiles/websockets_shared.dir/misc/prng.c.obj
[ 38%] Building C object lib/CMakeFiles/websockets_shared.dir/misc/lws-ring.c.obj
[ 38%] Building C object lib/CMakeFiles/websockets.dir/core/context.c.obj
[ 39%] Building C object lib/CMakeFiles/websockets.dir/core/lws_dll2.c.obj
[ 40%] Building C object lib/CMakeFiles/websockets.dir/core/lws_map.c.obj
[ 40%] Building C object lib/CMakeFiles/websockets.dir/core/libwebsockets.c.obj
[ 41%] Building C object lib/CMakeFiles/websockets_shared.dir/misc/cache-ttl/lws-cache-ttl.c.obj
[ 41%] Building C object lib/CMakeFiles/websockets_shared.dir/misc/cache-ttl/heap.c.obj
[ 42%] Building C object lib/CMakeFiles/websockets.dir/core/logs.c.obj
[ 42%] Building C object lib/CMakeFiles/websockets.dir/core/vfs.c.obj
[ 43%] Building C object lib/CMakeFiles/websockets.dir/misc/base64-decode.c.obj
[ 44%] Building C object lib/CMakeFiles/websockets_shared.dir/misc/cache-ttl/file.c.obj
[ 44%] Building C object lib/CMakeFiles/websockets.dir/misc/prng.c.obj
[ 44%] Building C object lib/CMakeFiles/websockets_shared.dir/misc/dir.c.obj
[ 45%] Building C object lib/CMakeFiles/websockets.dir/misc/lws-ring.c.obj
[ 46%] Building C object lib/CMakeFiles/websockets_shared.dir/misc/lwsac/lwsac.c.obj
[ 47%] Building C object lib/CMakeFiles/websockets_shared.dir/misc/lwsac/cached-file.c.obj
[ 47%] Building C object lib/CMakeFiles/websockets.dir/misc/cache-ttl/lws-cache-ttl.c.obj
[ 47%] Building C object lib/CMakeFiles/websockets_shared.dir/misc/sha-1.c.obj
[ 48%] Building C object lib/CMakeFiles/websockets.dir/misc/cache-ttl/heap.c.obj
[ 48%] Building C object lib/CMakeFiles/websockets.dir/misc/cache-ttl/file.c.obj
[ 49%] Building C object lib/CMakeFiles/websockets_shared.dir/misc/lejp.c.obj
[ 49%] Building C object lib/CMakeFiles/websockets_shared.dir/system/system.c.obj
[ 50%] Building C object lib/CMakeFiles/websockets_shared.dir/core-net/dummy-callback.c.obj
[ 51%] Building C object lib/CMakeFiles/websockets.dir/misc/dir.c.obj
[ 51%] Building C object lib/CMakeFiles/websockets_shared.dir/core-net/output.c.obj
[ 52%] Building C object lib/CMakeFiles/websockets.dir/misc/lwsac/lwsac.c.obj
[ 53%] Building C object lib/CMakeFiles/websockets_shared.dir/core-net/close.c.obj
[ 53%] Building C object lib/CMakeFiles/websockets_shared.dir/core-net/network.c.obj
[ 53%] Building C object lib/CMakeFiles/websockets.dir/misc/lwsac/cached-file.c.obj
[ 54%] Building C object lib/CMakeFiles/websockets.dir/misc/sha-1.c.obj
[ 54%] Building C object lib/CMakeFiles/websockets.dir/misc/lejp.c.obj
[ 55%] Building C object lib/CMakeFiles/websockets_shared.dir/core-net/vhost.c.obj
[ 55%] Building C object lib/CMakeFiles/websockets_shared.dir/core-net/pollfd.c.obj
[ 56%] Building C object lib/CMakeFiles/websockets_shared.dir/core-net/service.c.obj
[ 57%] Building C object lib/CMakeFiles/websockets.dir/system/system.c.obj
[ 57%] Building C object lib/CMakeFiles/websockets_shared.dir/core-net/sorted-usec-list.c.obj
[ 57%] Building C object lib/CMakeFiles/websockets.dir/core-net/dummy-callback.c.obj
[ 58%] Building C object lib/CMakeFiles/websockets_shared.dir/core-net/wsi.c.obj
[ 59%] Building C object lib/CMakeFiles/websockets.dir/core-net/output.c.obj
[ 60%] Building C object lib/CMakeFiles/websockets_shared.dir/core-net/wsi-timeout.c.obj
[ 60%] Building C object lib/CMakeFiles/websockets.dir/core-net/close.c.obj
[ 61%] Building C object lib/CMakeFiles/websockets.dir/core-net/network.c.obj
[ 61%] Building C object lib/CMakeFiles/websockets_shared.dir/core-net/adopt.c.obj
[ 61%] Building C object lib/CMakeFiles/websockets.dir/core-net/vhost.c.obj
[ 62%] Building C object lib/CMakeFiles/websockets.dir/core-net/pollfd.c.obj
[ 62%] Building C object lib/CMakeFiles/websockets.dir/core-net/service.c.obj
[ 63%] Building C object lib/CMakeFiles/websockets_shared.dir/roles/pipe/ops-pipe.c.obj
[ 63%] Building C object lib/CMakeFiles/websockets_shared.dir/core-net/state.c.obj
[ 64%] Building C object lib/CMakeFiles/websockets_shared.dir/core-net/client/client.c.obj
[ 64%] Building C object lib/CMakeFiles/websockets_shared.dir/core-net/client/connect.c.obj
[ 65%] Building C object lib/CMakeFiles/websockets.dir/core-net/sorted-usec-list.c.obj
[ 66%] Building C object lib/CMakeFiles/websockets.dir/core-net/wsi.c.obj
[ 67%] Building C object lib/CMakeFiles/websockets_shared.dir/core-net/client/connect2.c.obj
[ 67%] Building C object lib/CMakeFiles/websockets_shared.dir/core-net/client/connect3.c.obj
[ 68%] Building C object lib/CMakeFiles/websockets_shared.dir/core-net/client/connect4.c.obj
[ 68%] Building C object lib/CMakeFiles/websockets_shared.dir/core-net/client/sort-dns.c.obj
[ 68%] Building C object lib/CMakeFiles/websockets.dir/core-net/wsi-timeout.c.obj
[ 69%] Building C object lib/CMakeFiles/websockets.dir/core-net/adopt.c.obj
[ 70%] Building C object lib/CMakeFiles/websockets_shared.dir/core-net/client/conmon.c.obj
[ 70%] Building C object lib/CMakeFiles/websockets.dir/roles/pipe/ops-pipe.c.obj
[ 71%] Building C object lib/CMakeFiles/websockets_shared.dir/roles/http/header.c.obj
[ 71%] Building C object lib/CMakeFiles/websockets_shared.dir/roles/http/date.c.obj
[ 73%] Building C object lib/CMakeFiles/websockets.dir/core-net/state.c.obj
[ 73%] Building C object lib/CMakeFiles/websockets_shared.dir/roles/http/parsers.c.obj
[ 73%] Building C object lib/CMakeFiles/websockets_shared.dir/roles/http/server/server.c.obj
[ 73%] Building C object lib/CMakeFiles/websockets.dir/core-net/client/client.c.obj
[ 74%] Building C object lib/CMakeFiles/websockets_shared.dir/roles/http/server/lws-spa.c.obj
[ 74%] Building C object lib/CMakeFiles/websockets_shared.dir/roles/http/cookie.c.obj
[ 75%] Building C object lib/CMakeFiles/websockets_shared.dir/roles/http/server/lejp-conf.c.obj
[ 76%] Building C object lib/CMakeFiles/websockets.dir/core-net/client/connect.c.obj
[ 76%] Building C object lib/CMakeFiles/websockets_shared.dir/roles/h1/ops-h1.c.obj
[ 76%] Building C object lib/CMakeFiles/websockets.dir/core-net/client/connect2.c.obj
[ 77%] Building C object lib/CMakeFiles/websockets_shared.dir/roles/h2/http2.c.obj
[ 77%] Building C object lib/CMakeFiles/websockets_shared.dir/roles/h2/hpack.c.obj
[ 78%] Building C object lib/CMakeFiles/websockets.dir/core-net/client/connect3.c.obj
[ 78%] Building C object lib/CMakeFiles/websockets.dir/core-net/client/connect4.c.obj
[ 79%] Building C object lib/CMakeFiles/websockets.dir/core-net/client/sort-dns.c.obj
[ 80%] Building C object lib/CMakeFiles/websockets.dir/core-net/client/conmon.c.obj
[ 80%] Building C object lib/CMakeFiles/websockets.dir/roles/http/header.c.obj
[ 81%] Building C object lib/CMakeFiles/websockets_shared.dir/roles/h2/ops-h2.c.obj
[ 82%] Building C object lib/CMakeFiles/websockets.dir/roles/http/date.c.obj
[ 82%] Building C object lib/CMakeFiles/websockets.dir/roles/http/parsers.c.obj
[ 83%] Building C object lib/CMakeFiles/websockets_shared.dir/roles/ws/ops-ws.c.obj
[ 83%] Building C object lib/CMakeFiles/websockets_shared.dir/roles/ws/client-ws.c.obj
[ 84%] Building C object lib/CMakeFiles/websockets.dir/roles/http/server/server.c.obj
[ 85%] Building C object lib/CMakeFiles/websockets_shared.dir/roles/ws/client-parser-ws.c.obj
[ 85%] Building C object lib/CMakeFiles/websockets_shared.dir/roles/ws/server-ws.c.obj
[ 85%] Building C object lib/CMakeFiles/websockets.dir/roles/http/server/lws-spa.c.obj
[ 86%] Building C object lib/CMakeFiles/websockets_shared.dir/roles/raw-skt/ops-raw-skt.c.obj
[ 87%] Building C object lib/CMakeFiles/websockets.dir/roles/http/cookie.c.obj
[ 87%] Building C object lib/CMakeFiles/websockets.dir/roles/http/server/lejp-conf.c.obj
[ 88%] Building C object lib/CMakeFiles/websockets.dir/roles/h1/ops-h1.c.obj
[ 88%] Building C object lib/CMakeFiles/websockets_shared.dir/roles/raw-file/ops-raw-file.c.obj
[ 88%] Building C object lib/CMakeFiles/websockets.dir/roles/h2/http2.c.obj
[ 89%] Building C object lib/CMakeFiles/websockets_shared.dir/roles/listen/ops-listen.c.obj
[ 89%] Building C object lib/CMakeFiles/websockets_shared.dir/roles/http/client/client-http.c.obj
[ 90%] Building C object lib/CMakeFiles/websockets.dir/roles/h2/hpack.c.obj
[ 91%] Building C object lib/CMakeFiles/websockets.dir/roles/h2/ops-h2.c.obj
[ 92%] Building C object lib/CMakeFiles/websockets_shared.dir/event-libs/poll/poll.c.obj
[ 92%] Building C object lib/CMakeFiles/websockets_shared.dir/event-libs/libuv/libuv.c.obj
[ 92%] Building C object lib/CMakeFiles/websockets.dir/roles/ws/ops-ws.c.obj
[ 93%] Building C object lib/CMakeFiles/websockets.dir/roles/ws/client-ws.c.obj
[ 94%] Building RC object lib/CMakeFiles/websockets_shared.dir/__/win32port/version.rc.obj
[ 94%] Building C object lib/CMakeFiles/websockets.dir/roles/ws/client-parser-ws.c.obj
[ 95%] Building C object lib/CMakeFiles/websockets.dir/roles/ws/server-ws.c.obj
[ 95%] Building C object lib/CMakeFiles/websockets.dir/roles/raw-skt/ops-raw-skt.c.obj
[ 96%] Building C object lib/CMakeFiles/websockets.dir/roles/raw-file/ops-raw-file.c.obj
[ 96%] Building C object lib/CMakeFiles/websockets.dir/roles/listen/ops-listen.c.obj
[ 97%] Linking C shared library ../bin/libwebsockets.dll
[ 98%] Building C object lib/CMakeFiles/websockets.dir/roles/http/client/client-http.c.obj
[ 98%] Building C object lib/CMakeFiles/websockets.dir/event-libs/poll/poll.c.obj
[ 99%] Building C object lib/CMakeFiles/websockets.dir/event-libs/libuv/libuv.c.obj
[ 99%] Built target websockets_shared
[100%] Linking C static library libwebsockets_static.a
[100%] Built target websockets
Install the project...
-- Install configuration: "RELEASE"
-- Up-to-date: /mingw64/include/libwebsockets
-- Up-to-date: /mingw64/include/libwebsockets/abstract
-- Up-to-date: /mingw64/include/libwebsockets/abstract/abstract.h
-- Up-to-date: /mingw64/include/libwebsockets/abstract/protocols
-- Up-to-date: /mingw64/include/libwebsockets/abstract/protocols/smtp.h
-- Up-to-date: /mingw64/include/libwebsockets/abstract/protocols.h
-- Up-to-date: /mingw64/include/libwebsockets/abstract/transports
-- Up-to-date: /mingw64/include/libwebsockets/abstract/transports/raw-skt.h
-- Up-to-date: /mingw64/include/libwebsockets/abstract/transports/unit-test.h
-- Up-to-date: /mingw64/include/libwebsockets/abstract/transports.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-adopt.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-async-dns.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-bb-i2c.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-bb-spi.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-button.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-cache-ttl.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-callbacks.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-cgi.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-client.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-conmon.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-context-vhost.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-cose.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-dbus.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-diskcache.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-display.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-dll2.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-dsh.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-eventlib-exports.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-fault-injection.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-freertos.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-fts.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-genaes.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-gencrypto.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-genec.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-genhash.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-genrsa.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-gpio.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-http.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-i2c.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-ili9341-spi.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-jose.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-jwe.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-jwk.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-jws.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-lecp.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-led.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-lejp.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-logs.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-lwsac.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-map.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-metrics.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-misc.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-mqtt.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-netdev.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-network-helper.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-optee.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-protocols-plugins.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-purify.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-pwm.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-retry.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-ring.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-secure-streams-client.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-secure-streams-policy.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-secure-streams.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-sequencer.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-service.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-settings.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-sha1-base64.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-smd.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-spa.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-spi.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-ssd1306-i2c.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-state.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-struct.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-system.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-test-sequencer.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-threadpool.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-timeout-timer.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-tls-sessions.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-tokenize.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-vfs.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-write.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-writeable.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-ws-close.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-ws-ext.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-ws-state.h
-- Up-to-date: /mingw64/include/libwebsockets/lws-x509.h
-- Installing: /mingw64/include/libwebsockets.h
-- Installing: /mingw64/include/lws_config.h
-- Installing: /mingw64/cmake/libwebsockets-config.cmake
-- Installing: /mingw64/cmake/libwebsockets-config-version.cmake
-- Installing: /mingw64/cmake/LwsCheckRequirements.cmake
-- Installing: /mingw64/cmake/LibwebsocketsTargets.cmake
-- Installing: /mingw64/cmake/LibwebsocketsTargets-release.cmake
-- Installing: /mingw64/lib/libwebsockets_static.a
-- Installing: /mingw64/lib/libwebsockets.dll.a
-- Installing: /mingw64/bin/libwebsockets.dll
-- Installing: /mingw64/lib/pkgconfig/libwebsockets.pc
-- Installing: /mingw64/lib/pkgconfig/libwebsockets_static.pc
/d/projects/ttyd-main
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
-- The C compiler identification is GNU 12.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: D:/projects/msys2/mingw64/bin/cc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Could NOT find Git (missing: GIT_EXECUTABLE)
-- Found LIBUV: D:/projects/msys2/mingw64/lib/libuv.dll.a
-- Found JSON-C: D:/projects/msys2/mingw64/lib/libjson-c.dll.a
-- Found ZLIB: D:/projects/msys2/mingw64/lib/libz.dll.a (found version "1.2.12")
-- Looking for LWS_WITH_LIBUV
-- Looking for LWS_WITH_LIBUV - found
-- Looking for LWS_OPENSSL_SUPPORT
-- Looking for LWS_OPENSSL_SUPPORT - found
-- Looking for LWS_WITH_MBEDTLS
-- Looking for LWS_WITH_MBEDTLS - found
-- Configuring done
-- Generating done
-- Build files have been written to: D:/projects/ttyd-main/build
[ 16%] Building C object CMakeFiles/ttyd.dir/src/utils.c.obj
[ 33%] Building C object CMakeFiles/ttyd.dir/src/pty.c.obj
[ 50%] Building C object CMakeFiles/ttyd.dir/src/protocol.c.obj
[ 66%] Building C object CMakeFiles/ttyd.dir/src/http.c.obj
[ 83%] Building C object CMakeFiles/ttyd.dir/src/server.c.obj
[100%] Linking C executable ttyd.exe
[100%] Built target ttyd
Install the project...
-- Install configuration: "RELEASE"
-- Installing: C:/Program Files (x86)/ttyd/bin/ttyd.exe
-- Installing: C:/Program Files (x86)/ttyd/share/man/man1/ttyd.1
如果不是管理员身份运行minggw64,会报这个错误:
如果不在ttyd-main根目录运行mingw-build.sh,会报这个错误:
- 如果安装过程没有报错,那么你的ttyd-main目录下会生成一个build的文件夹,C:Program Files (x86)下也会有一个ttyd的文件夹,此时安装ttyd已成功。
此时可以打开windows的终端,进入到ttyd-main/build,运行
PS D:projectsttyd-mainbuild> ./ttyd bash
[2022/07/07 10:08:51:4403] N: ttyd 1.6.3 (libwebsockets 4.3.2-unknown)
[2022/07/07 10:08:51:4446] N: tty configuration:
[2022/07/07 10:08:51:4466] N: start command: bash
[2022/07/07 10:08:51:4486] N: close signal: SIGHUP (1)
[2022/07/07 10:08:51:4506] N: terminal type: xterm-256color
[2022/07/07 10:08:51:4526] N: lws_create_context: LWS: 4.3.2-unknown, NET CLI SRV H1 H2 WS MbedTLS ConMon IPv6-absent
[2022/07/07 10:08:51:4635] N: elops_init_pt_uv: Using foreign event loop...
[2022/07/07 10:08:51:4680] N: __lws_lc_tag: ++ [wsi|0|pipe] (1)
[2022/07/07 10:08:51:4770] N: __lws_lc_tag: ++ [vh|0|default||7681] (1)
[2022/07/07 10:08:51:4809] N: [vh|0|default||7681]: lws_socket_bind: source ads 0.0.0.0
[2022/07/07 10:08:51:4839] N: __lws_lc_tag: ++ [wsi|1|listen|default||7681] (2)
[2022/07/07 10:08:51:4879] N: Listening on port: 7681
- 可以在浏览器上输入https:localhost:7681打开ttyd了(ttyd的默认端口为7681)。
ttyd的其他命令可自行到官网查阅。
最后
以上就是缥缈蜜蜂为你收集整理的Windows安装ttyd(Web Terminal)的全部内容,希望文章能够帮你解决Windows安装ttyd(Web Terminal)所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复