websocketd(8)

✨ websocketd(8) β€” the manual page, but make it a group chat ✨

okay bestie, sit down, hydrate, because this one is iconic. This is the manual page for websocketd, and honestly? It's giving "tiny tool, massive slay." πŸ’…


🌸 NAME 🌸

websocketd β€” turns any program that uses STDIN/STDOUT into a WebSocket server.

periodt. that's the whole vibe. πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

websocketd [options] COMMAND [command args]

or

websocketd [options] --dir=SOMEDIR

like… pick a lane, both lanes are cute 🫢


πŸ’œ DESCRIPTION πŸ’œ

websocketd is a command line tool that will allow any executable program that accepts input on stdin and produces output on stdout to be turned into a WebSocket server.

no cap. your little script that just reads stdin and writes stdout? boom. WebSocket server. main character energy fr fr. ✨

To learn more about websocketd visit http://websocketd.com and project WIKI on GitHub! 🌈


πŸŽ€ OPTIONS πŸŽ€

A summary of the options supported by websocketd is included below.

  • --port=PORT β€” the HTTP port to listen on. that's the door, bestie πŸšͺ
  • --address=ADDRESS β€” the Address to bind to (multiple options allowed, yes you can stack them πŸ’…). Use square brackets to specify IPv6 address. Default: "" (all)
  • --sameorigin={true,false} β€” Restrict (HTTP 403) protocol upgrades if the Origin header does not match to requested HTTP Host. Default: false. so by default it's just vibes and open doors, set it to true if you want to be picky 🚫
  • --origin=host[:port][,host[:port]...] β€” Restrict (HTTP 403) protocol upgrades if the Origin header does not match to one of the host and port combinations listed. If the port is not specified, any port number will match. Default: "" (allow any origin). lowkey a VIP list, comma-separated and everything 🎟️
  • --ssl --sslcert=FILE --sslkey=FILE β€” Listen for HTTPS socket instead of HTTP. All three options must be used or all of them should be omitted. > it's all three or none, bestie, there is NO in-between 😭
  • --passenv VAR[,VAR...] β€” Lists environment variables allowed to be passed to executed scripts. like a lil guest list for your env vars πŸ“
  • --reverselookup={true,false} β€” Perform DNS reverse lookups on remote clients. Default: true
  • --dir=DIR β€” Allow all scripts in the local directory to be accessed as WebSockets. If using this, option, then the standard program and args options should not be specified. so like, pick one?? don't do both πŸ™ˆ
  • --staticdir=DIR β€” Serve static files in this directory over HTTP.
  • --cgidir=DIR β€” Serve CGI scripts in this directory over HTTP.
  • --help β€” Print help and exit. the classic 🫢
  • --version β€” Print version and exit.
  • --license β€” Print license and exit.
  • --devconsole β€” Enable interactive development console. This enables you to access the websocketd server with a web-browser and use a user interface to quickly test WebSocket endpoints. For example, to test an endpoint at ws://[host]/foo, you can visit http://[host]/foo in your browser. This flag cannot be used in conjunction with --staticdir or --cgidir. > obsessed with this one honestly, it's the "just test it in the browser" button 🧚✨ and yes it does NOT play nice with --staticdir or --cgidir
  • --loglevel=LEVEL β€” Log level to use (default access). From most to least verbose: debug, trace, access, info, error, fatal. so debug is the yapper and fatal is the one who speaks once and only once πŸ’€

🌈 SEE ALSO 🌈

go read, bestie, the wiki is cute πŸ’–


😭 BUGS 😭

The only known condition so far is that certain applications in programming languages that enforce implicit STDOUT buffering (Perl, Python, etc.) would be producing unexpected data passing delays when run under websocketd. Such issues could be solved by editing the source code of those applications (prohibiting buffering) or modifying their environment to trick them into autoflush mode (e.g. pseudo-terminal wrapper "unbuffer").

translation: your Perl/Python script is holding the message in drafts instead of sending it πŸ™ˆ and yeah you gotta fix that on your side, either by editing the source (no buffering, periodt) or by tricking it into autoflush mode with something like the pseudo-terminal wrapper "unbuffer".

Active issues in development are discussed on GitHub: https://github.com/joewalnes/websocketd/issues.

Please use that page to share your concerns and ideas about websocketd, authors would greatly appreciate your help! 🫢 drop your thoughts, they're literally asking for them.


πŸ‘‘ AUTHOR πŸ‘‘

Copyright 2013-2014 Joe Walnes and the websocketd team. All rights reserved.

BSD license: Run websocketd --license for details.


okay that's the whole page, you ate it, go build something πŸ’…πŸ’–

this was version 0.0, dated 28 Sep 2014, from the websocketd(8) manual β€” and that's the sign-off, bestie. mwah. πŸŽ€βœ¨