Skip to content

Commit

Permalink
add option to change internal port
Browse files Browse the repository at this point in the history
  • Loading branch information
sonroyaalmerol committed Nov 11, 2024
1 parent bfb80fc commit 24f63b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ Access the generated M3U playlist at `http://<server ip>:8080/playlist.m3u`.

| ENV VAR | Description | Default Value | Possible Values |
|-----------------------------|----------------------------------------------------------|---------------|------------------------------------------------|
| PORT | Set listening port of service inside the container. | 8080 | Any valid port |
| PUID | Set UID of user running the container. | 1000 | Any valid UID |
| PGID | Set GID of user running the container. | 1000 | Any valid GID |
| TZ | Set timezone | Etc/UTC | [TZ Identifiers](https://nodatime.org/TimeZones) |
Expand Down
5 changes: 3 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"context"
"fmt"
"m3u-stream-merger/database"
"m3u-stream-merger/m3u"
"m3u-stream-merger/proxy"
Expand Down Expand Up @@ -54,10 +55,10 @@ func main() {
})

// Start the server
utils.SafeLogln("Server is running on port 8080...")
utils.SafeLogln(fmt.Sprintf("Server is running on port %s...", os.Getenv("PORT")))
utils.SafeLogln("Playlist Endpoint is running (`/playlist.m3u`)")
utils.SafeLogln("Stream Endpoint is running (`/proxy/{originalBasePath}/{streamID}.{fileExt}`)")
err = http.ListenAndServe(":8080", nil)
err = http.ListenAndServe(fmt.Sprintf(":%s", os.Getenv("PORT")), nil)
if err != nil {
utils.SafeLogFatalf("HTTP server error: %v", err)
}
Expand Down

0 comments on commit 24f63b6

Please sign in to comment.