发布时间: ,大约 300 字 ,阅读时间:2 分钟,
前几天在接触 noVNC 的时候发现 WebSockify 可以将任意 TCP 流量转换成 WebSocket 的时候突发奇想,想试试 CloudFlare 免费版 WebSocket 的速度有多快(🌚) 安装 于是,参照 WebSockify 项目页 ,搞起。 服务端我用的是 Debian/Ubuntu,apt search websockify 发现居然有这个包,所以我直接 sudo apt install websockify -y 了,然后让我们来看看帮助: $ websockify --help Usage: websockify [options] [source_addr:]source_port [target_addr:target_port] websockify [options] [source_addr:]source_port -- WRAP_COMMAND_LINE Options: -h, --help show this help message and exit -v, --verbose verbose messages --traffic per frame traffic --record=FILE record sessions to FILE.[session_number] -D, --daemon become a daemon (background process) --run-once handle a single WebSocket connection and exit --timeout=TIMEOUT after TIMEOUT seconds exit when not connected --idle-timeout=IDLE_TIMEOUT server exits after TIMEOUT seconds if there are no active connections --cert=CERT SSL certificate file --key=KEY SSL key file (if separate from cert) --ssl-only disallow non-encrypted client connections --ssl-target connect to SSL target as SSL client --unix-target=FILE connect to unix socket target --web=DIR run webserver on same port.