1 (edited by chumby3000 2017-10-17 22:59:34)

Topic: Chumby can not play https streams?

http://listen.noagendastream.com/noagenda.pls
This playlist contains a single https stream - https://listen.noagendastream.com/noagenda and does not play. btplayd tries to open a file instead sad

Software version 1.7.3

Re: Chumby can not play https streams?

General purpose proxy cgi-bin script allowing https streams to be played:

proxy.cgi

#!/bin/sh

if [ "$REQUEST_METHOD" != "GET" ]; then
  echo "HTTP/1.0 501 Not implemented"
  echo "Content-type: text/plain"
  echo
  echo "Not implemented"
  exit 1
fi
# Allow local access only
if [ "$REMOTE_ADDR" != "127.0.0.1" ]; then
  echo "HTTP/1.0 403 Forbidden"
  echo "Content-type: text/plain"
  echo
  echo "Forbidden"
  exit 1
fi
# Minimum 20 chars for the url length
if [ ${#QUERY_STRING} -lt 20 ]; then
  echo "HTTP/1.0 400 Bad request"
  echo "Content-type: text/plain"
  echo
  echo "Bad request"
  exit 1
fi

exec /usr/bin/curl -0isS "$QUERY_STRING"

Now you can play https://www.foo.bar/baz as

http://localhost/cgi-bin/custom/proxy.cgi?https://www.foo.bar/baz

If you have version 1.7.2 of chumby software or earlier, you might need to add -k to the list of curl options.

3 (edited by chumby3000 Today 00:33:15)

Re: Chumby can not play https streams?

Due to upgrades of the encryption software, the curl binary installed on chumby is no longer able to connect to most TLS sites and the previous recipe no longer works. It should be possible to compile a new curl version but if you have access to a box able to run nginx, here is a solution. It assumes nginx's IP is 192.168.0.11 and it listens on port 8080; substitute for your own

location /chumby {
    proxy_ssl_server_name   on;
    proxy_hide_header "Referer";
    proxy_buffering         off;
    proxy_redirect          http:// http://192.168.0.11:8080/chumby?http://;
    proxy_redirect          https:// http://192.168.0.11:8080/chumby?https://;
    sub_filter  'https://' 'http://192.168.0.11:8080/chumby?https://';
    sub_filter  'http://'  'http://192.168.0.11:8080/chumby?http://' ;
    sub_filter_once off;
    sub_filter_types audio/x-mpegurl audio/x-scpls;
    proxy_pass $query_string;
  }

Now in order to access a stream at

https://foo.com/bar

  you need to specify

http://192.168.0.11:8080/chumby?https://foo.com/bar