I've been trying to set up a web radio station using icecast2 and liquidsoap. I also used a cloudflared tunnel to circumvent my ISP's cgNAT. Everything seems to be working alright except that i cannot use the server's domain name to connect the liquidsoap source. I've tried using the https and http port to no avail. I suspect i might be using the wrong command as it works flawlessly if i use the local ip instead. Unfortunately, i couldn't find any mention of another command in the documentation i read. Also, i would have tried using the global IP but unfortunately cloudflare does not allow that. This is the liquidsoap i used (modified version of a script i found online):
#Settings
set("server.telnet", true)
set("server.telnet.port", 1234)
set("harbor.bind_addr","0.0.0.0")
# Music playlists
music1 = playlist("~/music/music1")
# Some jingles
jingles = playlist("~/music/jingles")
# If something goes wrong, we'll play this
security = single("~/music/default.ogg")
# Start building the feed with music
radio = random([music1])
# Add the security, requests and smart crossfade
radio = fallback(track_sensitive = false, [crossfade(fallback([request.queue(id="request"),radio])),security])
# Now add some jingles
radio = mksafe(random(weights = [1, 7],[jingles, radio])) # This plays
# a jingle once every approximately seven songs, change 7 to
# another number to change this
# Add a skip command for the music stream
server.register(
usage="skip",
description="Skip the current song.",
"skip",
fun(_) -> begin source.skip(radio) "Done!" end)
#Add support for live streams.
live = audio_to_stereo(input.harbor("live",port=8080,password="pw1",buffer=1.0))
#dontpanic1764 is the
# password used to connect a live stream; it can (and should) be
# different from the source-password in icecast.xml.
full = fallback(track_sensitive=false,
[live,radio])
# Dump archives
file_name = '~/archives/%Y-%m-%d-%H:%M:%S$(if $(title),
↪"-$(title)","").ogg'
output.file(%vorbis,file_name,live,fallible=true)
# Stream it out
output.icecast(%mp3.vbr,
host = "0.0.0.0", port = 1234,
password = "pw0", mount = "music.mp3",
name="myStation Music Service", description="This is the myStation
↪music stream. Add some information about your station's automated
↪programming.",
radio)
output.icecast(%vorbis,
host = "0.0.0.0", port = 1234,
password = "pw0", mount = "music.ogg",
name="myStation Music Service", description="This is the myStation
↪music stream. Add some information about your station's
↪automated programming.",
radio)
output.icecast(%opus(vbr="unconstrained",bitrate=60),
host = "0.0.0.0", port = 1234,
password = "pw0", mount = "music.opus",
name="myStation Music Service", description="This is the myStation
↪music stream. Add some information about your station's
↪automated programming.",
radio)
output.icecast(%mp3.vbr,
host = "0.0.0.0", port = 1234,
password = "pw0", mount = "stream.mp3",
name="myStation Main Stream", description="The myStation main stream.",
full)
output.icecast(%vorbis,
host="0.0.0.0",port= 1234,password="pw0",
mount="stream.ogg",
name="myStation Main Stream", description="The myStation main stream.",
full)
output.icecast(%opus(vbr="unconstrained",bitrate=60),
description="The myStation main stream.",
host="0.0.0.0",port= 1234,password="pw0",
mount="stream.opus",
full)