joewalnes/websocketd là dự án Go với 17.5k sao. Turn any program that uses STDIN/STDOUT into a WebSocket server. Like inetd, but for WebSockets.
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
websocketd is a small command-line tool that will wrap an existing command-line interface program, and allow it to be accessed via a WebSocket.
WebSocket-capable applications can now be built very easily. As long as you can write an executable program that reads STDIN and writes to STDOUT, you can build a WebSocket server. Do it in Python, Ruby, Perl, Bash, .NET, C, Go, PHP, Java, Clojure, Scala, Groovy, Expect, Awk, VBScript, PowerShell, Haskell, Lua, R, whatever! No networking libraries necessary.
-@joewalnes
Details
Upon startup, websocketd will start a WebSocket server on a specified port, and listen for connections.
Upon a connection, it will fork the appropriate process, and disconnect the process when the WebSocket connection closes (and vice-versa).
Any message sent from the WebSocket client will be piped to the process's STDIN stream, followed by a \n newline.
Any text printed by the process to STDOUT shall be sent as a WebSocket message whenever a \n newline is encountered.
Download
If you're on a Mac, you can install websocketd using Homebrew. Just run brew install websocketd. For other operating systems, or if you don't want to use Homebrew, check out the link below.
Download for Linux, OS X and Windows
Quickstart
To get started, we'll create a WebSocket endpoint that will accept connections, then send back messages, counting to 10 with 1 second pause between each one, before disconnecting.
To show how simple it is, let's do it in Bash!
count.sh:
#!/bin/bash
for ((COUNT = 1; COUNT <= 10; COUNT++)); do
echo $COUNT
sleep 1
done
Before turning it into a WebSocket server, let's test it from the command line. The beauty of websocketd is that servers work equally well in the command line, or in shell scripts, as they do in the server - with no modifications required.
Open this page in your web-browser. It will even work if you open it directly
from disk using a file:// URL.
More Features
Very simple install. Just download the single executable for Linux, Mac or Windows and run it. Minimal dependencies, no installers, no package managers, no external libraries. Suitable for development and production servers.
Server side scripts can access details about the WebSocket HTTP request (e.g. remote host, query parameters, cookies, path, etc) via standard CGI environment variables.
As well as serving websocket daemons it also includes a static file server and classic CGI server for convenience.
Can listen on a Unix domain socket (--unixsocket) instead of, or alongside, a TCP address — useful for exposing websocketd only to processes on the same host, e.g. behind an SSH-forwarded or reverse-proxied socket.
STDERR can optionally be forwarded to WebSocket clients (--passstderr), tagged alongside STDOUT as JSON so a client can tell the two apart.
Command line help available via websocketd --help.
Includes WebSocket developer console to make it easy to test your scripts before you've built a JavaScript frontend.
Examples in many programming languages are available to help you getting started.
User Manual
More documentation in the user manual
Example Projects
Plot real time Linux CPU/IO/Mem stats to a HTML5 dashboard using websocketd and vmstat (for Linux)
Arbitrary REPL in the browser using websocketd
Retrieve SQL data from server with LiveCode and webSocketd
List files from a configured folder (for Linux)
Listen for gamepad events and report them to the system (this + android = gamepad emulator)
Got more examples? Open a pull request.
My Other Projects
ReconnectingWebSocket - Simplest way to add some robustness to your WebSocket connections.
Smoothie Charts - JavaScript charts for streaming data.
joewalnes/websocketd có 17.5k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/joewalnes/websocketd. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
joewalnes/websocketd có những chủ đề gì?
GitHub topics của joewalnes/websocketd: "proxy", "websocket-server", "websockets". TopGit xếp repo vào nhóm mã nguồn mở.
joewalnes/websocketd còn đang phát triển không?
Commit gần nhất trên joewalnes/websocketd là 1 tháng trước (theo timestamp GitHub). Repo có 1.0k fork — một chỉ báo về mức độ quan tâm của cộng đồng.
joewalnes/websocketd là gì?
joewalnes/websocketd (joewalnes/websocketd) là dự án Go trên GitHub. Theo mô tả gốc: Turn any program that uses STDIN/STDOUT into a WebSocket server. Like inetd, but for WebSockets.
joewalnes/websocketd viết bằng ngôn ngữ gì?
joewalnes/websocketd chủ yếu viết bằng Go. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Đọc đầy đủ README ở tab phía trên.
websocketd có đáng để bạn bỏ thời gian?
ChatGPT, Claude và Perplexity đều đọc được trang này. Hỏi thử xem họ nghĩ gì về websocketd.