1

I'm already looking for days for a solution but I'm not able to find something. I have a few IP camera's (Dahua) which don't have an option for unauthorized, public so to say, viewing. I'm now looking for a proxy server which can do the following:

  1. Connect to the IP camera stream (MJPEG)
  2. If the camera returns a 401 the proxy must login with a saved username and password
  3. Transmit the IP camera stream

I can accomplish this with nginx by adding the Authorization header but, and this is the difficult part, only when the camera uses Basic authentication.

Some models however only support Digest authentication which is not static.

Can someone point me to some software or nginx/apache plugin which can do this? I'm looking for something like this https://github.com/jantman/python-amcrest-noauth-proxy but written in C so that I can run it on OpenWRT embedded device.

Kind regards, Daan

Daan Pape
  • 1,100
  • 1
  • 13
  • 25
  • I have this same issue. Did you find a solution? – aaguilera Jul 07 '23 at 09:38
  • 1
    I still could not find any solution. I have an open bug report at Mozilla but it is not yet handled at this point. We keep using HTTP as the default access technology for now (and loose many browser features) and expanded the user manual when HTTPS is required. It is really frustrating. – Daan Pape Jul 10 '23 at 07:25

1 Answers1

1

I used fcgiwrap with curl to do this.

nginx.conf:

server {
    listen 8080;
    root /usr/share/nginx/html;

    location /tmp/ {
        internal;
        alias /tmp/;
    }

    location / {
        include fastcgi_params;
        fastcgi_pass unix:/var/run/fcgiwrap.socket;
    }
}

screenshot.cgi:

#!/bin/bash

TMPF=$(mktemp /tmp/screenshot_XXXXXXX.jpg)

curl -sL --digest --output $TMPF http://guest:guest@10.100.0.95/cgi-bin/snapshot.cgi?1

echo -e "X-Accel-Redirect: $TMPF"
echo -e ""
Thnesko
  • 108
  • 2
  • 4