Skip to content

CLI ​

sh
ahpw serve [options]
OptionWhat it does
--connect URLThe server's socket: ws://, wss://, http://, https:// or HOST:PORT
--token SECRETThe token to add to the socket
--token-file PATHRead the token from a file
--host ADDRBind here, default 127.0.0.1
--port NListen here, default 5190. 0 picks a free port
--openOpen the page in a browser once it is served
--client-name NAMEThe name the server's client list shows for the page, default ahpw
--client-title TITLEThe title the server's client list shows for the page, default ahpw
--tls-cert PATHServe https with this certificate, a PEM file. Needs --tls-key
--tls-key PATHThe private key of --tls-cert, a PEM file
--domain NAMEThe name the page is reached by, as the certificate names it. A page there may open the socket, as one at an IP address or localhost may

http:// and https:// name the same port as ws:// and wss://. A bare HOST:PORT is taken as ws://HOST:PORT.

A tkn= in the --connect URL counts as the token. Give one of --token, --token-file or a tkn=, not two.

Give --tls-cert and --tls-key together, or neither. --domain is a bare host name, with no scheme, port or path.

A flag beats the config file, and the file beats the environment.