Skip to content
Snippets Groups Projects
Commit 20a9f2bc authored by Simon Kirsten's avatar Simon Kirsten
Browse files

Updated docs

parent 38100dae
No related branches found
No related tags found
No related merge requests found
cert.pem 0 → 100644
-----BEGIN CERTIFICATE-----
MIIBhTCCASugAwIBAgIQIRi6zePL6mKjOipn+dNuaTAKBggqhkjOPQQDAjASMRAw
DgYDVQQKEwdBY21lIENvMB4XDTE3MTAyMDE5NDMwNloXDTE4MTAyMDE5NDMwNlow
EjEQMA4GA1UEChMHQWNtZSBDbzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABD0d
7VNhbWvZLWPuj/RtHFjvtJBEwOkhbN/BnnE8rnZR8+sbwnc/KhCk3FhnpHZnQz7B
5aETbbIgmuvewdjvSBSjYzBhMA4GA1UdDwEB/wQEAwICpDATBgNVHSUEDDAKBggr
BgEFBQcDATAPBgNVHRMBAf8EBTADAQH/MCkGA1UdEQQiMCCCDmxvY2FsaG9zdDo1
NDUzgg4xMjcuMC4wLjE6NTQ1MzAKBggqhkjOPQQDAgNIADBFAiEA2zpJEPQyz6/l
Wf86aX6PepsntZv2GYlA5UpabfT2EZICICpJ5h/iI+i341gBmLiAFQOyTDT+/wQc
6MF9+Yw1Yy0t
-----END CERTIFICATE-----
...@@ -14,4 +14,4 @@ This is a very simple helper to call the Stream Server. See the [reference](refe ...@@ -14,4 +14,4 @@ This is a very simple helper to call the Stream Server. See the [reference](refe
<!-- Insert StreamServerClient.java --> <!-- Insert StreamServerClient.java -->
``` java linenums="1" ``` java linenums="1"
--8<-- "docs/assets/StreamServerClient.java" --8<-- "docs/assets/StreamServerClient.java"
``` ```
\ No newline at end of file
...@@ -59,6 +59,5 @@ Darwin (macOS) | 64 bit | [stream-server](/bin/~~~${VERSION}~~~/darwin-x86_64/s ...@@ -59,6 +59,5 @@ Darwin (macOS) | 64 bit | [stream-server](/bin/~~~${VERSION}~~~/darwin-x86_64/s
* listen tcp 0.0.0.0:8080: bind: address already in use * listen tcp 0.0.0.0:8080: bind: address already in use
> Something is already using the port. This could be another Stream Server instance or some other application (like a webserver). > Something is already using the port. This could be another Stream Server instance or some other application (like a webserver).
> Close / disable the other service or change the port via the [command-line options](options.md). > Close / disable the other service or change the port via the [command-line options](options.md).
...@@ -17,24 +17,35 @@ USAGE: ...@@ -17,24 +17,35 @@ USAGE:
stream-server [global options] [arguments...] stream-server [global options] [arguments...]
VERSION: VERSION:
v0.9.9 v1.0.0
GLOBAL OPTIONS: GLOBAL OPTIONS:
--port value, -p value http port to listen on (default: 8080) --port value http port to listen on (default: 8080)
--browser, -b automatically open the default browser --tlsport value https port to listen on (default: 8443)
--local, -l only listen on 127.0.0.1 (see doc) --listen value address to listen on (default: "0.0.0.0")
--help, -h show help --tlscert value TLS cert
--version, -v print the version --tlskey value TLS key
--use-host-namespace use the Host header as namespace
--help, -h show help
--version, -v print the version
``` ```
By default stream-server listens on all ip addresses on port 8080. This means that it is exposed to the local network (LAN / WLAN) which is needed if the app is on a phone. Note that the phone must be in the same network as the computer / laptop. By default stream-server listens on all ip addresses on port 8080. This means that it is exposed to the local network (LAN / WLAN) which is needed if the app is on a phone. Note that the phone must be in the same network as the computer / laptop.
When using the Android Emulator on the same device as the server this exposure is not necessary. Use the `--local` flag to only listen on `127.0.0.1` aka `localhost`. The emulator must then connect to `10.0.2.2` as described here: When using the Android Emulator on the same device as the server this exposure is not necessary. Use the `--listen 127.0.0.1` flag to only listen on `127.0.0.1` aka `localhost`. The emulator must then connect to `10.0.2.2` as described here:
> Also note that the address 127.0.0.1 on your development machine corresponds to the emulator's own loopback interface. If you want to access services running on your development machine loopback interface (a.k.a. 127.0.0.1 on your machine), you should use the special address 10.0.2.2 instead. > Also note that the address 127.0.0.1 on your development machine corresponds to the emulator's own loopback interface. If you want to access services running on your development machine loopback interface (a.k.a. 127.0.0.1 on your machine), you should use the special address 10.0.2.2 instead.
> >
> [Android Studio - User guide](https://developer.android.com/studio/run/emulator-networking#networkaddresses) > [Android Studio - User guide](https://developer.android.com/studio/run/emulator-networking#networkaddresses)
## Advanced configuration
- HTTPS can be enable by providing a TLS cert and key. If both config values are present a additional HTTPS server is spawned on the tlsport.
- By default the stream-server has only one namespace, meaning that all incoming requests reference the same display.
With `--use-host-namespace` the _Host_ header is used as a namespace. This means that each different host has a different display.
This can be used to dynamically host different displays on one stream-server instance.
New displays are created on demand.
## Environment Variables ## Environment Variables
The `TWITCH_CLIENT_ID` environment variable can be set. This is only necessary during development to access the Twitch API. All official release builds ship with a default client id but you can still supply your own if you want. The `TWITCH_CLIENT_ID` environment variable can be set. This is only necessary during development to access the Twitch API. All official release builds ship with a default client id but you can still supply your own if you want.
...@@ -5,8 +5,8 @@ $ ./stream-server ...@@ -5,8 +5,8 @@ $ ./stream-server
``` ```
``` ```
Serving on Serving on
http://127.0.0.1:8080 http://localhost:8080
http://192.168.0.66:8080 http://10.0.2.15:8080
Read the quickstart at https://stream-server.h-da.io/quickstart to get started. Read the quickstart at https://stream-server.h-da.io/quickstart to get started.
Stop with Ctrl-C or close this terminal. Stop with Ctrl-C or close this terminal.
``` ```
...@@ -15,10 +15,10 @@ Stop with Ctrl-C or close this terminal. ...@@ -15,10 +15,10 @@ Stop with Ctrl-C or close this terminal.
In the examples of this documentation only the local address is used. If you want to connect from your phone or the emulator you need to use the network address (`192.168.0.66` in this case). Also we assume you use the default port `8080`. In the examples of this documentation only the local address is used. If you want to connect from your phone or the emulator you need to use the network address (`192.168.0.66` in this case). Also we assume you use the default port `8080`.
1. Open <http://127.0.0.1:8080> in a browser. Leave this tab / window open while you do the other steps. 1. Open <http://localhost:8080> in a browser. Leave this tab / window open while you do the other steps.
2. Get the current state of the display: 2. Get the current state of the display:
<pre><code><http://127.0.0.1:8080/display></code></pre> <pre><code><http://localhost:8080/display></code></pre>
``` java ``` java
StreamServerClient client = new StreamServerClient("10.0.2.2:8080"); StreamServerClient client = new StreamServerClient("10.0.2.2:8080");
...@@ -38,7 +38,7 @@ Stop with Ctrl-C or close this terminal. ...@@ -38,7 +38,7 @@ Stop with Ctrl-C or close this terminal.
3. Find some stream on twitch: 3. Find some stream on twitch:
<pre><code><http://127.0.0.1:8080/twitch/getTopStreams></code></pre> <pre><code><http://localhost:8080/twitch/getTopStreams></code></pre>
``` java ``` java
List<JSONObject> topStreams = client.twitchGetTopStreams(null, null, null); // no filters List<JSONObject> topStreams = client.twitchGetTopStreams(null, null, null); // no filters
``` ```
...@@ -66,9 +66,9 @@ Stop with Ctrl-C or close this terminal. ...@@ -66,9 +66,9 @@ Stop with Ctrl-C or close this terminal.
4. Start playback of your selected stream with chat and muted volume: 4. Start playback of your selected stream with chat and muted volume:
<pre><code><http://127.0.0.1:8080/display?large_channel={channel name here}&volume=0&show_chat=true></code></pre> <pre><code><http://localhost:8080/display?large_channel=CHANNEL-NAME&volume=0&show_chat=true></code></pre>
``` java ``` java
client.display("channel name here", null, 0.0f, null, true); client.display("CHANNEL-NAME", null, 0.0f, null, true);
``` ```
!!! example !!! example
...@@ -84,4 +84,4 @@ Stop with Ctrl-C or close this terminal. ...@@ -84,4 +84,4 @@ Stop with Ctrl-C or close this terminal.
The tab / window from step 1 should now start playing that stream with the provided settings. The tab / window from step 1 should now start playing that stream with the provided settings.
5. Read the [Reference](reference.md). 5. Read the [Reference](reference.md).
\ No newline at end of file
...@@ -21,14 +21,14 @@ Returns [`DisplayState`](#displaystate). ...@@ -21,14 +21,14 @@ Returns [`DisplayState`](#displaystate).
??? example "Examples" ??? example "Examples"
* Only set the large_channel to riotgames * Only set the large_channel to riotgames
<pre><code><http://127.0.0.1:8080/display?large_channel=riotgames></code></pre> <pre><code><http://localhost:8080/display?large_channel=riotgames></code></pre>
``` java ``` java
/* JSONObject newState = */ client.display("riotgames", null, null, null, null); /* JSONObject newState = */ client.display("riotgames", null, null, null, null);
``` ```
* Set the large_channel to monstercat, disable the small_channel, set the volume to 0.8 and hide the chat. * Set the large_channel to monstercat, disable the small_channel, set the volume to 0.8 and hide the chat.
Notice the small_scale is not changed (because of its absence) Notice the small_scale is not changed (because of its absence)
<pre><code><http://127.0.0.1:8080/display?large_channel=monstercat&small_channel=&volume=0.8&show_chat=false></code></pre> <pre><code><http://localhost:8080/display?large_channel=monstercat&small_channel=&volume=0.8&show_chat=false></code></pre>
``` java ``` java
/* JSONObject newState = */ client.display("monstercat", "", 0.8f, null, false); /* JSONObject newState = */ client.display("monstercat", "", 0.8f, null, false);
``` ```
...@@ -47,7 +47,7 @@ Returns [`Game`](#game) array. ...@@ -47,7 +47,7 @@ Returns [`Game`](#game) array.
??? example "Examples" ??? example "Examples"
* Get top games * Get top games
<pre><code><http://127.0.0.1:8080/twitch/getTopGames></code></pre> <pre><code><http://localhost:8080/twitch/getTopGames></code></pre>
``` java ``` java
List<JSONObject> topGames = client.twitchGetTopGames(); List<JSONObject> topGames = client.twitchGetTopGames();
``` ```
...@@ -67,13 +67,13 @@ Returns [`Game`](#game) array. ...@@ -67,13 +67,13 @@ Returns [`Game`](#game) array.
??? example "Examples" ??? example "Examples"
* Search for the "game" Talk Shows & Podcasts * Search for the "game" Talk Shows & Podcasts
<pre><code><http://127.0.0.1:8080/twitch/searchGames?query=talk%20show></code></pre> <pre><code><http://localhost:8080/twitch/searchGames?query=talk%20show></code></pre>
``` java ``` java
List<JSONObject> foundGames = client.twitchSearchGames("talk show"); List<JSONObject> foundGames = client.twitchSearchGames("talk show");
``` ```
* Search for ove (will show games starting with "ove" like Overwatch) * Search for ove (will show games starting with "ove" like Overwatch)
<pre><code><http://127.0.0.1:8080/twitch/searchGames?query=ove></code></pre> <pre><code><http://localhost:8080/twitch/searchGames?query=ove></code></pre>
``` java ``` java
List<JSONObject> foundGames = client.twitchSearchGames("ove"); List<JSONObject> foundGames = client.twitchSearchGames("ove");
``` ```
...@@ -99,25 +99,25 @@ Returns [`Stream`](#stream) array. ...@@ -99,25 +99,25 @@ Returns [`Stream`](#stream) array.
??? example "Examples" ??? example "Examples"
* Get the unfiltered top streams * Get the unfiltered top streams
<pre><code><http://127.0.0.1:8080/twitch/getTopStreams></code></pre> <pre><code><http://localhost:8080/twitch/getTopStreams></code></pre>
``` java ``` java
List<JSONObject> topStreams = client.twitchGetTopStreams(null, null, null); List<JSONObject> topStreams = client.twitchGetTopStreams(null, null, null);
``` ```
* German top streams * German top streams
<pre><code><http://127.0.0.1:8080/twitch/getTopStreams?language=de></code></pre> <pre><code><http://localhost:8080/twitch/getTopStreams?language=de></code></pre>
``` java ``` java
List<JSONObject> topStreams = client.twitchGetTopStreams(null, null, "de"); List<JSONObject> topStreams = client.twitchGetTopStreams(null, null, "de");
``` ```
* English top streams in Talk Shows and Podcasts * English top streams in Talk Shows and Podcasts
<pre><code><http://127.0.0.1:8080/twitch/getTopStreams?language=en&game=Talk%20Shows%20%26%20Podcasts></code></pre> <pre><code><http://localhost:8080/twitch/getTopStreams?language=en&game=Talk%20Shows%20%26%20Podcasts></code></pre>
``` java ``` java
List<JSONObject> topStreams = client.twitchGetTopStreams(null, "Talk Shows and Podcasts", "en"); List<JSONObject> topStreams = client.twitchGetTopStreams(null, "Talk Shows and Podcasts", "en");
``` ```
* Tip: If your app implements a favorite list you can very easily query these channels and see who is streaming and other information * Tip: If your app implements a favorite list you can very easily query these channels and see who is streaming and other information
<pre><code><http://127.0.0.1:8080/twitch/getTopStreams?channels=xqcow,dafran,kitboga></code></pre> <pre><code><http://localhost:8080/twitch/getTopStreams?channels=xqcow,dafran,kitboga></code></pre>
``` java ``` java
String[] favoriteChannels = {"xqcow", "dafran", "kitboga"}; String[] favoriteChannels = {"xqcow", "dafran", "kitboga"};
...@@ -136,7 +136,7 @@ Returns [`Stream`](#stream) array. ...@@ -136,7 +136,7 @@ Returns [`Stream`](#stream) array.
??? example "Examples" ??? example "Examples"
* Get featured streams * Get featured streams
<pre><code><http://127.0.0.1:8080/twitch/getFeaturedStreams></code></pre> <pre><code><http://localhost:8080/twitch/getFeaturedStreams></code></pre>
``` java ``` java
List<JSONObject> featuredStreams = client.twitchGetFeaturedStreams(); List<JSONObject> featuredStreams = client.twitchGetFeaturedStreams();
``` ```
...@@ -188,4 +188,4 @@ Returns [`Stream`](#stream) array. ...@@ -188,4 +188,4 @@ Returns [`Stream`](#stream) array.
* The image at the `preview_img_url` url updates itself every couple of seconds. If the app uses preview images it could also. * The image at the `preview_img_url` url updates itself every couple of seconds. If the app uses preview images it could also.
* `started_at` is an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp. * `started_at` is an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp.
* `video_height`: `#!json 1080` = `HD`, `#!json < 1080` = `SD`, `#!json > 1080` = `UHD`. * `video_height`: `#!json 1080` = `HD`, `#!json < 1080` = `SD`, `#!json > 1080` = `UHD`.
* `mature`: If the stream is meant for mature audiences (set by the streamer themselves as a guideline). * `mature`: If the stream is meant for mature audiences (set by the streamer themselves as a guideline).
\ No newline at end of file
k3s.yaml 0 → 100644
apiVersion: v1
clusters:
- cluster:
certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUJWekNCL3FBREFnRUNBZ0VBTUFvR0NDcUdTTTQ5QkFNQ01DTXhJVEFmQmdOVkJBTU1HR3N6Y3kxelpYSjIKWlhJdFkyRkFNVFU1TWpZeE1qY3lNakFlRncweU1EQTJNakF3TURJMU1qSmFGdzB6TURBMk1UZ3dNREkxTWpKYQpNQ014SVRBZkJnTlZCQU1NR0dzemN5MXpaWEoyWlhJdFkyRkFNVFU1TWpZeE1qY3lNakJaTUJNR0J5cUdTTTQ5CkFnRUdDQ3FHU000OUF3RUhBMElBQkFGUTdlUWhjK3IxQkdxQjB5WThFdXNJbmtacXdQcjB5cGUxN2FlTUF3RnEKdjhzc3lOTHFrQUI1ZlVvbFBOR2VqeENPd2pxaElkbG9tWkJTQnZScTdJQ2pJekFoTUE0R0ExVWREd0VCL3dRRQpBd0lDcERBUEJnTlZIUk1CQWY4RUJUQURBUUgvTUFvR0NDcUdTTTQ5QkFNQ0EwZ0FNRVVDSUJORTVXbHZ5VlprClArNlB0WUJUUFFFQzRFY3k0NjNQdk1zNnhBU29Cb0JtQWlFQXVqY1JsamtDd1BEMjJ4dmVZQVhQVzZmRDBvQ1UKY0pldll4UHNXT2tYMHZvPQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==
server: https://127.0.0.1:6443
name: default
contexts:
- context:
cluster: default
user: default
name: default
current-context: default
kind: Config
preferences: {}
users:
- name: default
user:
password: 77f4f381bb04e6e873e5eb29282592bc
username: admin
-----BEGIN EC PRIVATE KEY-----
MHcCAQEEIIrYSSNQFaA2Hwf1duRSxKtLYX5CB04fSeQ6tF1aY/PuoAoGCCqGSM49
AwEHoUQDQgAEPR3tU2Fta9ktY+6P9G0cWO+0kETA6SFs38GecTyudlHz6xvCdz8q
EKTcWGekdmdDPsHloRNtsiCa697B2O9IFA==
-----END EC PRIVATE KEY-----
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment