Recipe for livestreaming over Tor
ファイルへ移動
n9k fdf4713c71 Licence headers in every new file 2022-06-16 01:31:10 +00:00
LICENSES
anonstream Licence headers in every new file 2022-06-16 01:31:10 +00:00
.gitignore
HACKING.md HACKING.md: document control and event sockets 2022-06-16 00:53:39 +00:00
README.md HACKING.md: document control and event sockets 2022-06-16 00:53:39 +00:00
STREAMING.md Minor readme changes 2022-06-13 22:53:28 +00:00
app.py Licence headers formatting 2022-06-16 01:31:10 +00:00
config.toml Event socket 2022-06-15 03:53:34 +00:00
requirements.txt
title.txt

README.md

anonstream

Recipe for livestreaming over Tor

Repo

The canonical location of this repo is https://git.076.ne.jp/ninya9k/anonstream.

These mirrors also exist:

Setup

You must have Python 3.10 at a minimum. You can check your version of Python with python --version.

Clone the repo:

git clone https://git.076.ne.jp/ninya9k/anonstream.git
cd anonstream

Install dependencies in a virtual environment:

python -m venv venv
source venv/bin/activate
python -m pip install -r requirements.txt

Before you run it you may want to edit the config (/config.toml). Most of the defaults are probably okay, but here are some that you might want to know what they do:

  • secret_key: used for cryptography, make it any long random string (e.g. $ dd if=/dev/urandom bs=16 count=1 | base64), definitely set this yourself before running in "production" (whatever that is for you)

  • segments/directory: directory containing stream segments, the default is stream/ in the cloned repository

  • title/file: location of the stream title, the default is title.txt in the cloned repository

  • captcha/fonts: locations of fonts for the captcha, leaving it blank will use the default font

Run it:

python -m uvicorn app:app --port 5051

This will start a webserver listening on the local host at port 5051.

If you go to http://localhost:5051 in a web browser now you should see the site. When you started the webserver some credentials were printed in the terminal; you can log in with those at http://localhost:5051/login.

The only things left are (1) streaming, and (2) letting other people access your stream. /STREAMING.md has instructions for setting up OBS Studio and a Tor onion service. If you want to use different streaming software and put your stream on the Internet some other way, read those instructions and copy the gist.

Hacking

anonstream has APIs for accessing internal state and hooking into internal events. They can be used by humans and other programs. See /HACKING.md.

Copying

anonstream is AGPL 3.0 or later, see /LICENSES/AGPL-3.0-or-later.md.

Assets

Dependencies