Documentation ¶
Overview ¶
Webserver for mcxhub
Index ¶
Constants ¶
const ( FRONTPAGE = "index.html" DefaultErrorMessage = "ERROR\n\n\nS A T O R\nA R E P O\nT E N E T\nO P E R A\nR O T A S" )
Variables ¶
This section is empty.
Functions ¶
func IRCWebSocket ¶
HTTP/WebSocket suitable for connecting javascript clients, and whatnot.
Takes a websocket and attaches it to the IRC server, such that whatever you write to the websocket is handled just like as it was an IRC connection. It also does some rewriting of the TCP stream, so that each websocket frame replied back to you will consist of only one IRC command/response message, and also removes trailing \r\n (weird IRC-syntax newlines). All commands you send to the socket NEED to end with newlines (either \n or \r\n), and you are allowed to send frames that contain multiple lines. See also RawIRCWebSocket(). Blocks until connection disconnect.
func RawIRCWebSocket ¶
Takes a websocket and attaches it to the IRC server. Does not reformat the datastream. Useful if you want to connect *anything*. Blocks until the (servers internal representation of the) IRCUser dies.
func StartWebServer ¶
func StartWebServer()
Starts the mcxhub web server. Assumes the presence of an initialized mcxconfig. Does not return, unless error or shutdown occured.
Types ¶
type WebVariables ¶
type WebVariables struct { FullName string ShortName string Software string Version string Quote string IRCPort int WebPort int Host string }
func MakeWebVariables ¶
func MakeWebVariables(r *http.Request) WebVariables
Extracts and creates a WebVariables datastruct, to be used in http templates