Hi there, I'm currently hosting my website on my own computer, and I'm using http://www.no-ip.com to allow me to do so as I have a dynamic IP. (updates the pointers, when my IP changes.. for the domain name).
I have now set up my webcamera to have a have stream on it, the camera is in port 8081, and when I type internally 192.168.1.150:8081; (internal is static @ .150 for my PC), I get to view my web cam.
I would like to also put this through my domain name and a link on my webpage, for this... although when linking it in the html file, I would need to put my current ip and port (i.e. 25.54.65.255:8081); and this does work when outside of the network, although I would like it so I don't have to hard code my IP, because as I said, it's dynamic!

How could I get around this? would work?
If so, how would I get this to work, because it's currently not working!

Before you ask, Yes Port 80 and Port 8081 are both forwarded. As I said, the camera stream does work when connecting with my ip and port, although I just want a solution to how to link to this port "dynamic.ip.goes.here:8081"; without having to change the IP in the html file, every time my ip changes.

If I'm not describing it well, please let me know and I'll see if I can do a better job at it!
Many thanks, Toby.

Dani AI

Generated

Short answer for : the cleanest, stable approach is to keep your dynamic-DNS name but terminate incoming HTTP(S) on port 80/443 and proxy those requests to your camera on 192.168.1.150:8081. That hides the port from users, works for a subdomain (camera.domain.com) or a path (domain.com/camera), and lets you add TLS and access controls. As pointed out, host-header routing is the right idea; ’s “what’s my IP” approach can work but is fragile compared with dynamic DNS + proxying.

Minimal examples (place on the machine that listens on 80/443 and forwards to your camera):

# nginx (example)
server {
  listen 80;
  server_name camera.domain.com;
  location / {
    proxy_pass http://192.168.1.150:8081;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
  }
}
# Apache (example)
<VirtualHost *:80>
  ServerName camera.domain.com
  ProxyPreserveHost On
  ProxyPass / http://192.168.1.150:8081/
  ProxyPassReverse / http://192.168.1.150:8081/
</VirtualHost>

Practical notes and gotchas: if you already host a site on port 80, run the proxy on that host and route by ServerName rather than remapping ports on the router. If internal clients can’t reach camera.domain.com because your router blocks NAT loopback (hairpin NAT), fix it with split-horizon DNS or by adding a local hosts entry that resolves camera.domain.com to 192.168.1.150. If you control the root domain remember DNS rules: you can add a subdomain CNAME to your dynamic-hostname, but you cannot put a CNAME at the zone apex without special provider support (use ALIAS/ANAME or an A record).

Security checklist: enable HTTPS (Let’s Encrypt on the proxy is easy), require authentication, keep camera firmware updated, and restrict access (firewall or VPN) if the stream is private. Following that pattern gives a neat URL, automatic dynamic-IP handling, and safer remote access.

Recommended Answers

All 6 Replies

You already indicated you are using no-IP.com. I haven't used that service, but if it provides you with a free hostname and dynamic DNS services then you should be good to go.

In your HTML page, you would reference the no-IP hostname:8081

Or an alternative solution would be to hit a 3rd party service such as "What's my IP" using something along the lines of:

file_get_contents("");

This shall give you the server's actual WAN IP.

Okay thanks! Since I've already got the no-IP Dynamic DNS Service set up, I'll be using JorgeM's solution. Is there any way I can use "Camera.DomainNameHere.com" to go to DomainnameHere.com:8081?
Or is that not possible, and I would have to do DomainNameHere.com/Camera, to take me to port 8081.

Thanks again, AHarrisGsy & JorgeM

If you own the domain name, you can just create an alias record in yiur DNs zone called camera and point it to your no-IP.com hostname. For example...

Camera.myDomain.com --> myAccount.no-IPdomain.com (or whatever hostname they give you)

You then can access your camera like this::

Http://Camera.myDomain.com:8081

If you don't have a domain name and you only have a no-IP domain name, you can only have the hostname camera if no-IP allows custom records to be created for the host and/domain name they assign you.

You can also do but this will require you in your website code to perform a redirect to

You can also do camera.yourDomain.com and on your website using .htaccess/URL Rewriting, redirect the user to http://no-IPDomain.com:8081

Hope this helps... If not, I clarify it in more detail.

Hi JorgeM, Thanks so much for the indepth responce.
I understand what you're saying and so far I have working, although I'd like it to be a little neater than that!

I seem to have 2 options,
1] (the least prefered method), Allow the user to type and redirect them to
2] (the more prefered method), Allow the user to type [or (although I think this uses a webpage, where I am using YawCam to display it, and I don't actually place a webpage anywhere)] and this URL will not change, but will allow them to see (or MyIp:8081) <-- which are both the same thing

Is there any way to allow Option [2] to happen?

Thanks again JorgeM.

So I am under the impression that you already have a website hosted on a computer in your network as per your description in your first post. I'm not concerned about the camera web services.

If you are running a webserver, you could host an additional website that is listening for the host header "camera.domain.com". The only purpose of this site is to redirect the user to port 8081.

If you don't have a webserver, another alternative is to configure your router to map port 80 --> 8081. This would allow you to use the URL without defining the port because the router will do that work for you. However this is only applicable if port 80 is free to use.

For option 2 I don't see any technical problems other than going through the setup.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.