Solved

Hide IP of Private Host

Posted on 2013-05-13
7
321 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 108

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 108

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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 75

Accepted Solution

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

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
This article discusses four methods for overlaying images in a container on a web page
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …

743 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

12 Experts available now in Live!

Get 1:1 Help Now