Getting user's full address on internet for transfer - php

Is there a way to get a user's full address on the internet, using php, so that the address can be send to a client application on another computer on the internet and enable it to transfer files directly?
What I'm trying to do is: I have put together a desktop application in vb.net that will exchange live webcam feed between computers on a lan. However, I want to enable the users to exchange the feed via the internet, but the only servers I will have at my disposal are simple lamp servers. I'd like to write a script in php that the desktop application can periodically connect to so that the server can confirm the computer's availability as well as maintain it's physical address. Then, when a computer's desktop webcam app wants to connect to the other, it can check the php server to make sure it's available and grab it's physical address to know where to send the udp packets to.
Also, if anybody has a better suggestion as to how to deal with this need, I'd try anything that might work. I'm a paramedic at an ambulance service who loves to play with code and my boss is wanting to be able to use our mobile internet connections on our trucks to be able to provide live feed to the local trauma center and interact with trauma surgeons during our transports. I'm making great progress so far, but this is kind of where I'm stuck. Any suggestions would be greatly appreciated! Thanks in advance!

Have you looked at OpenTok? Its a javascript based video chatting solution. The service costs money, but is very affordable (free for 25,000 minutes a month)

Related

How to best secure my home automation webserver?

I have set up a small raspberry pi home automation from scratch along with some ipcams to surveil my house.
All those are controlled by a small webpage (with relay switches and video feeds) i have set up that works very well within my home network.
I was thinking of setting up a dyndns account (as i dont have a static ip) in order to be able to access all those things remotely through 4G.
Obviously i dont just want to point an open port to my web page and just make it accessible online.
How to i make this secure? Here are my thoughts:
Do i set up a quick Joomla! site inside my network that ill have to log in every time? (or something similar - im just familiar with Joomla!)
Is there some way to password protect the website with .htaccess? Is it safe? could you point me out to a guide?
Is there some way to restrict access only to my cellphone's 4G mac address?
Is there some way to set up some vpn or other "tunnel" between my phone and home? (I wouldnt want it to apply to all my phone's traffic though)
Do i have this all wrong and there's some other awesome way to do what i need?
Please keep in mind that i would appreciate simplicity and ease of connection every time ill access the website. ie. i wouldnt want to log in every time i need to open my garage while driving near the house.
Lastly i was thinking of posting this in some other stack subforum but i ended up here, if you think there is some more suitable community please let me know.
Thanks in advance
Password protect it. However, hackers can hack the IP cameras. Find vulnerabilities in the software and patch them. Port forwarding to IP cameras should be safe. You can use Hamachi for a tunnel but it requires you to have a computer. You can restrict access by IP address. There will be guides on the Internet. Google is the best option for you.

Surveillance through Arduino and Web

I wanted to ask if it is possible to send the video feed from a camera to an Arduino board, and through the ethernet sheild send it to an Apache web server, and then displaying it on the browser in some form. I am not trying to transmit the audio and video together, just the video. Audio is not my concern at all..
I have seen people sending JPEG images across the web but never a video. I am new to both the web and arduino, so i don't even know if it is simple enough to send live streams through a web server even without using the Arduino and using a PC instead. If it is possible, i would be much obliged if a link is provided to the possible php/html functions that might be used for this task, as these are the only web languages that i use.
It is not possible since all Arduino boards have very weak processing power to handle video streaming.
Also, data cant be transfered through the serial link fast enough and there is not enough SRAM space to buffer the frames.
Personally, i recommend trying Raspberry PI + Motion for live streaming video.
If you want to stick with Arduino, the upcoming Tre board i think will be able to do such a job, but it will be way more expensive than the PI solution.
Check these links:
Raspberry PI webcam server tutorial
Raspberry Pi remote webcam

How to inform site that app is installed?

When user enter my site they receive a dialogue box proposing to install my wonderful app. When the user presses the accept button, the play market page with my app pops up.
This dialog box appears only if user browses from phone.
However, this dialog will popup even if user has my app already. Thus, I am interested in a way to inform site about presence/absence of an app on the phone. If app already installed on a phone, dialog should not appear.
phone w/o app -> browse site -> get dialoge box
phone with app -> browse site -> normal browsing
Simple and useless solution which comes in mind:
If link is opened from my app, it is extended with some action to identify that app is installed.
It is useless, because app is all-sufficient, so opening site will not give any benefit.
A bit more advanced idea was proposed by msh: Give user an option which app will open a link. If link is opened with my app as above.
Is there a better way to do this ?
Yes, Mobile Browsers (on their own) cannot communicate the application installed status to web. But still if you are desperate to implement this behavior, I have got a "WILD" solution for you.
This Solution is divided in two parts: Client Side (Android Device) / Server Side (Web)
Client Side (on Android Device):
In your application you'll need to implement a BroadcastReciever that will be continuously listening to the Network State changes. Whenever a broadcast is received for new network connection available (e.g. when the user turns on the Mobile Data), your app should read the acquired IP address and communicate it to your web-server (using HttpURLConnection).
Communicating the IP address will inform your web-server that the device browsing your website from this IP address has got your application installed.
Server Side (on Web Server):
Your web-server will keep a track of all the IP addresses reported by all the devices on which your application is installed(off-course in a database). To avoid redundant entries you can decide a expiry/validation time for each IP address record received.
Now when your server receives a web request, it will match the IP of the requesting client with all the IP's that were saved in its database. If it finds a matching IP, it means that the web request has come from a device on which your application is already installed. Otherwise you can direct the user to your app's play store link.
Limitation of proposed Solution: This solution will work with 100% accuracy only in the case when the user is using Mobile Data (2g / 3g / etc) to connect to internet. Since using Mobile Data, everytime the device will be issued a unique IP address by the service provider.
This wont work perfectly for wi-fi connections. While browsing using a wi-fi, all the devices that are connected to same wi-fi spot are allocated the same IP address. So there may be a situation where two mobile phones are using internet from same wi-fi spot, out of which one phone has your application installed and the other phone does not. This will confuse the server.
** This solution may not be highly recommended, but could be used with some minor fixes if you don't get any other solutions ;)
It is not possible of course, browser doesn't leak phone configuration and installed apps to random websites (I hope, or somebody has to fix it ASAP)
You can probably make your app react to the VIEW Intent with certain URL then redirect to that URL on your site, but that will make Android ask the user whether they want to open this URL with your app or the browser, so it is not transparent
You could have two seperate urls like: www.yousite.com and www.app.yoursite.com. This way at least the users are free of the popup from the app.

How can I stream live webcam video using Adobe flex without using Flash server or Red5?

My hosting service doesn't allow Flash server or Red5 to be used on the shared hosting account, only with a VPS account. This is something, I do not want to pay for. I have managed to create a MXML application and successfully compile it into a .SWF file that will grab the user's live cam. Now the problem I'm having is displaying that webcam to other users. So I'm assuming I need some sort of server to send that video to, so that I can connect to it, and then display the stream. Now my question is, is there a work around in which I don't need another server, such as Red5 or Flash server? Why can I not handle the live webcam myself and display the live stream using ActionScript3.0?
Go for Adobe Cirrus as Reboog711 mentioned. Its a peer-2-peer protocol.
Well to answer your questions..
is there a work around in which I don't need another server, such as
Red5 or Flash server?
Yes, you don't need any servers involved here. Just connect to the service and get a token id. Exchange that token id with your remote end user and do the vice-versa, such that both of you can able to see yourselves.
Why can I not handle the live webcam myself and display the live
stream using ActionScript3.0?
Who said you can't ;) ? You can very well control the settings including the webcam video size, aspect ratio, quality, bandwidth , etc everything using your actionscript 3.0.

My webcam to local website ( Live Stream & Image Capture)

I began thinking of a side-project recently that will make use of usb triggered relay switches to allow interaction between the internet and mechanical objects (something like click a button on a site and ring a real bell).
Now I have this part figured out but what I'd love to do is have this captured, live on streaming video via a webcam (and potential take a snapshot at a specific time). I'm pretty sure I'd have to use some sort of scripting language that can interact with hardware (flash/flex/silverlight). Also consider that this will be hosted locally, on the computer that has the webcam. Any Ideas? Thanks!
I would suggest writing a kiosk type of application in adobe air. You can capture the camera pretty easily and some simple network event listening to tell it when to snap some video.
Sounds somewhat interesting, if you need some help let me know (my stack nick has my email)

Categories