Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Hide IP of Private Host

Posted on 2013-05-13
7
Medium Priority
?
332 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 111

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 111

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
Industry Leaders: 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!

 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 1200 total points
ID: 39163694
0
 
LVL 111

Assisted Solution

by:Ray Paseur
Ray Paseur earned 800 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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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 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…
Suggested Courses

618 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