Solved

Hide IP of Private Host

Posted on 2013-05-13
7
325 Views
Last Modified: 2013-05-14
I have a weather webcam setup at home.  However, I'd like a little security to prevent the everyday hacker from causing an issue.

I'd like to be able to stream the webcam video from my webcam at home, to my website (hosted elsewhere), but have the website server being the one fetching the stream from my house, so the user's browser gets it from my server.  Not directly from my house.  Meaning, to the user's browser it looks like http://mywebsite.com/videostream, not not http://myhomeipaddress:1234.

Is this possible?  I assume there is a way to do this with PHP.  I just don't know how.
0
Comment
Question by:usmcguy
  • 3
  • 2
  • 2
7 Comments
 
LVL 109

Expert Comment

by:Ray Paseur
ID: 39162899
Yes, it would seem possible to me.  Write a PHP script that makes an HTTP request to http://myhomeipaddress:1234.  In the script at the home IP address, test for some kind of signal string in the HTTP request (Maybe something like http://myhomeipaddress:1234?foo=bar) and simply die if the signal string is not presented.  

Install the HTTP request script at http://mywebsite.com/videostream and whenever it gets a request (from the clients on the internet) it can call the home IP, retrieve the response, and replay it to the client.
0
 

Author Comment

by:usmcguy
ID: 39163168
I understand what that means, but I don't know how to implement it.  I'm not well versed in PHP.  I can look at the code and understand what it's doing, but coming up with it, is a bit more tricky.  Can you point me in the right direction?  Recommend php commands or anything would be great.
0
 
LVL 109

Expert Comment

by:Ray Paseur
ID: 39163264
You're in an area that does not really consist of a question with any answer -- it's more like a requirement for application development, and for that you would be well served to hire a professional application developer.  Integration of web services is an advanced topic in PHP, so choose your developer wisely.

If you decide you want to learn PHP so you can do this sort of thing yourself, I recommend this book for a starting point.  Giving yourself a month of study will put you a year ahead of the trial-and-error crowd.
http://www.amazon.com/PHP-MySQL-Web-Development-Edition/dp/0672329166/

Best regards, and best of luck with it (and I'm sorry I do not have time right how to write it for you), ~Ray
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 300 total points
ID: 39163694
0
 
LVL 109

Assisted Solution

by:Ray Paseur
Ray Paseur earned 200 total points
ID: 39164455
@Michel: Good link!  I especially liked the look of this one, although I have not tested it.
http://willbradley.name/2012/09/ip-camera-proxy-in-php-and-html/
0
 

Author Comment

by:usmcguy
ID: 39165483
Gentleman,  thanks for both of your comments.  @mplungjan, getting me to do a search using Curl with PHP was exactly what I needed.

The tricky part was determing the boundry for my camera source.  I am using a Raspberry Pi computer running mjpg-streamer with a Logitech C525 webcam attached.  I found that the boundy for it was "boundarydonotcross".  Once I found that out, I was able to get my website setup the way I wanted. Not sure if it's the best way, but it's doing what I want.

Here's the code that I used.
<?php

header('Content-type: multipart/x-mixed-replace; boundary=--boundarydonotcross');
$useragent="Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16";

while (@ob_end_clean());

$ch = curl_init();
curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
curl_setopt($ch, CURLOPT_URL, 'http://myhomeipaddress:1234/?action=stream');
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
//did not need password, but left line below anyway.
curl_setopt($ch, CURLOPT_USERPWD, 'USERNAME:PASSWORD');
// $output contains the output string
$output = curl_exec($ch);
echo $output;
// close curl resource to free up system resources
curl_close($ch);

?>

Open in new window

0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 39166642
Great, thanks for sharing
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

815 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now