Solved

Hide IP of Private Host

Posted on 2013-05-13
7
328 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
Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

 
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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

707 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