add ices2 sample config block
This commit is contained in:
19
README.md
19
README.md
@@ -1,7 +1,7 @@
|
|||||||
# icyws
|
# icyws
|
||||||
A tiny ices2 input module. It does two things:
|
A tiny ices2 input module. It does two things:
|
||||||
* Runs a WebSocket server on port 8765 that broadcasts the current song as `Artist - Title`
|
* Runs a WebSocket server on port 8765 that broadcasts the current song as `Artist - Title`
|
||||||
* When run with no arguments, picks a random song from a newline‑separated file list, prints its full path, extracts metadata, and tells the WebSocket server
|
* When run with no arguments: picks a random song from a newline-separated file list, prints the path to stdout. Then, extracts metadata and tells the WebSocket server
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
@@ -15,20 +15,27 @@ icyws serve --bind :8765 --allow-origin *
|
|||||||
ICYWS_TRACKLIST=tracks.txt icyws
|
ICYWS_TRACKLIST=tracks.txt icyws
|
||||||
```
|
```
|
||||||
|
|
||||||
This prints the selected file path to stdout and broadcasts the now‑playing info.
|
This prints the selected file path to stdout and broadcasts the now-playing info.
|
||||||
|
|
||||||
### Track list format
|
### Track list format
|
||||||
A plain text file with one absolute file path per line.
|
A plain text file with one absolute file path per line.
|
||||||
|
|
||||||
|
### ices2 config
|
||||||
|
```xml
|
||||||
|
<input>
|
||||||
|
<module>playlist</module>
|
||||||
|
<param name="type">script</param>
|
||||||
|
<param name="program">ICYWS_TRACKLIST=/etc/ices2/playlist.txt /usr/local/bin/icyws</param>
|
||||||
|
</input>
|
||||||
|
```
|
||||||
|
|
||||||
### WebSocket endpoint
|
### WebSocket endpoint
|
||||||
Connect to: `/ws/radio`
|
Connect to: `/ws/radio`
|
||||||
|
|
||||||
Receives: `Artist - Title` whenever a new song is selected
|
Receives: `Artist - Title` whenever a new song is selected
|
||||||
|
|
||||||
### Announcement endpoint (internal)
|
### Announcement endpoint (internal)
|
||||||
If the websocket (serve mode) is live, picker mode POSTs to:
|
If the websocket (serve mode) is live, picker mode POSTs to: `/announce`
|
||||||
```
|
|
||||||
/announce
|
|
||||||
```
|
|
||||||
|
|
||||||
### Build
|
### Build
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user