Rearranged how the RTMP and HTTP servers are started so they could be
gracefully shutdown easier.
Currently, only the HTTP server is gracefully shutdown. I'm unsure if
it is even possible for the RTMP server. The documentation for the RTMP
library is basically non-existent, so it's impossible to know for sure
without diving into the library code.
A new setting has been added to change the address and port that the
RTMP server listens on. `RtmpListenAddress` in the settings json and
`-r` on the command line. Both options use the same format:
`host:port`.
The -a flag has been added to allow specifying a new admin password on
the command line. This password will only be used for the current
session and will not be written to the configuration file. If the
password contains spaces, wrap it in quotes on the command line. The
quotes should be omitted with the /auth command.
Eg, starting the server with:
./MovieNight -a "the admin password"
the auth command in chat would be:
/auth the admin password
It's ugly, but it get's the job done. This list will need to be
improved a lot (ie, make it searchable and maybe even clickable
emotes?). This is for #99, but should not be considered fixed yet.
This is for #32.
This adds a starting framework for loading, caching, and executing
templates on the server and the client. Currently only the server uses
this functionality.
This reverts commit 13d74faf01, reversing
changes made to ec0c6752bc.
These changes completely broke the RTMP stream. Reverting until I
figure out why.
Functions added:
- LogErrorf()
- LogErrorln()
- LogChatf()
- LogChatln()
- LogInfof()
- LogInfoln()
- LogDebugf()
- LogDebugln()
- LogDevf()
- LogDevln()
New settings configure the logging: LogLevel and LogFile. LogLevel can
be set to one of: error, chat, info, or debug and will default to
error. LogFile is an optional file to write to. Providing a file will
not prevent output in the console.
LogDevf() and LogDevln() only compile when the "dev" flag passed to
build. This will cause Travis-CI to fail the build if it finds any
calls to either function.
So far only PIN and Open modes are implemented. It uses a session
cookie to store the validity of the pin/password.
The "Enter pin" page has some unreadable messages on it right now, but
it kinda works.
Stream statistics will now print when enabled in settings.json. There is messages in, messages out,
and total time running. The main function was changed so the server setups for the main and rtmp
are in separate functions, and both are started with their own goroutine. OS Interrupt catching was added,
and if stream stats is true, the stats will be printed.
Added the "Cache-Control" header to responses for the main.wasm file.
This should help with debugging and updates by telling the browser not
to cache the web assembly binary.
Move the help html to a template and populate the lists dynamically.
This also splits out the base HTML stuff (eg, the <html> and <body>
tags) to a base template file.
When typing @ a div will show up with all the chat names that match.
When up or down arrow keys are pressed, the highlight changes.
Tab handling is currently incomplete but the event is prevented.
issue #7
handlePublish, handlePlay, and handleDefault have been added in
handlers.go and removed as anonymous functions in main.go. This also
required moving some struct and variable definitions around a bit.
Instead of using a GET value in the URL, split on the path separators
and use the second element of the path as the key. This enables
putting the stream key in the appropriate settings in OBS, instead of
appending it to the stream URL manually.