case "$_COOKIE[watch]" in
raspi)
- #rpiaddr="http://atoemchen.helmchyn.no-ip.biz/?action=watch"
- #redirect "${rpiaddr}&url=$(urlsafe "http://${HTTP_HOST}/${videourl}")&return=$(urlsafe "http://${HTTP_HOST}/${_POST[page]}")"
- ncat atoemchen 80 >&- <<-EOF
+ ncat "$RHOST" "$RPORT" >&- <<-EOF
GET /?action=watch&url=$(urlsafe "http://${HTTP_HOST}/${videourl}") HTTP/1.1$(printf \\r)
- Host: atoemchen$(printf \\r)
+ Host: ${RHOST}$(printf \\r)
$(printf \\r)
EOF
redirect "?p=playctl&${watch_link}w=$(urlsafe "${_POST[page]}#${_GET[i]}")"
#!/bin/zsh
-# Copyright 2014,2015 Paul Hänsch
+# Copyright 2014 - 2017 Paul Hänsch
#
# This file is part of Serve0.
#
cgi_cookie
_COOKIE[pagesize]=$(validate "${_COOKIE[pagesize]}" '[1-9][0-9]*' 50)
+
+[ -z "$RHOST" ] && RHOST=localhost
+[ -z "$RPORT" ] && RPORT=80
debug VIDEO: $video
if [ "$_COOKIE[watch]" = raspi ]; then
- actionuri='//atoemchen/?action=playctl'
- volume="$({ncat atoemchen 80 <<-EOF
+ actionuri="//${RHOST}:${RPORT}/?action=playctl"
+ volume="$({ncat "$RHOST" "$RPORT" <<-EOF
GET /?action=playctl&api=volume HTTP/1.0${CR}
- Host: atoemchen${CR}
+ Host: ${RHOST}${CR}
${CR}
EOF
} | sed -r '1,/^\r$/d')"
progress(){
if [ "$_COOKIE[watch]" = raspi ]; then
- { ncat atoemchen 80 <<-EOF
+ { ncat "$RHOST" "$RPORT" <<-EOF
GET /?action=playctl&api=progress HTTP/1.0${CR}
- Host: atoemchen${CR}
+ Host: ${RHOST}${CR}
${CR}
EOF
} | sed -ur '1,/^\r$/d'