Proxy local Webview urls?

Tags: #<Tag:0x00007f6173a51e10> #<Tag:0x00007f6173a51d20> #<Tag:0x00007f6173a51af0>

I have OH2 working through my.openhab - YEAH!

But I have a Foscam cam that I’d like to be able to view and control. I’ve locked it down so it can’t talk to the outside world, and the outside world can’t get to it.

I was planning to use DDNS and reverse proxy to allow access to the camera. But my ISP has my router hidden in another layer of routers, so I don’t have access to a public IP to forward.

So far I tried setting up the Webview to local url, which works as expected locally, but not via myopenhab remote URL.

I really didn’t think it would matter, but I also tried wrapping the call in a small html with an iframe; Webview to static/page.html which pulled the local/LAN page. That didn’t work either.

I’ve seen some mentions about being able to configure myopenhab to be able to proxy other LAN/local urls. I’ve been unable to find any details on how to do this.

Any suggestions?

-Troy

1 Like

I would also be interested in doing something like this. Myopenhab successfully reads the index.html file but cannot execute its content:
“script type=“text/javascript” src=“create24HrTempCht.js”></script”
(Note tag arrows removed.)
This is a bit beyond my skill level but can my public ip address be used or “static” as a prefix for files in the html folder? I presume “static” would muck up the local running of the script.

Also if the following works ok locally
http://192.168.1.106:8080/static/index24hPwr.html

then will {public_ip_address}:8080/static/index24hPwr.html
also work without opening a port on the modem?

Not exactly an answer to the OP’s question but maybe a handy workaround if you have not come across it. I loaded up ngrok from ngrok.com on my Raspberry Pi, created a login at the ngrok site and at the command line on the Pi typed:
./ngrok http 8080
This gives a secure URL which happily displays the OH UIs or, with /static/, will load any html file in the /etc/opnehab2/html folder including my live charts.
So @troyp this may give you remote access to your camera images.
HTH

It’s a little bit late, but in case you have a server you can forward ports via SSH and run a proxy on the server (or even allow direct access to the forwarded port(s)). Using autossh this works very reliable. It does not require an own or static IP on the home side. DDNS is then also needless.

Should myopenhab not have a function to do local proxy? I mean many are running all kinds of services outside of openhab that they want to integrate should that not be possible?

1 Like

Has there been any resolution on this? This is EXACTLY my situation as well.

1 Like