Solved

Hide IP of Private Host

Posted on 2013-05-13
7
327 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 110

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 110

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
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 
LVL 75

Accepted Solution

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

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

This article will show, step by step, how to integrate R code into a R Sweave document
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…

730 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