I'm currently using cocoahttpserver to do some file sharing thing in my iPhone app. Does anyone know how to use public IP address to connect to the phone, that is to use the Internet, rather than internal connection via WiFi.
Any help would be appreciated! Thanks in advance.
Some thoughts on running an HTTP server on an iPhone:
Most of the time, with IPv4 addresses, the IP address is what is known as a “NAT” address. Simply put, the address it uses can only be accessed from other computers on the same network. It usually can not be accessed from the internet at large.
IPs can can be accessed from the internet at large cost quite a bit of money to have. They do not exist for wireless 3G networks.
Web servers like Apache and lighthttpd compile and run fine on an iPhone. However, the iPhone needs to be jailbroken before running these servers (but there appears to be a web server app for the iPhone)
Apache needs text files to be edited to be configured. It’s a great web server, but people who want to use it better be comfortable reading documentation and editing text files by hand.
Related
I have this strange problem that i haven't been able to figure out. Can anyone please suggest what to try:
I have a piece of software to control my camera from my computer. It's called "Control my Nikon". It has a built-in web server. The purpose is to be able to connect from a smartphone to use it as a remote control. You choose what port it should listen to and enable it. You get a simple interface with buttons. Exposing a photo, for example, triggers the URL 127.0.0.1:8090/?c=3. Very basic stuff.
On the computer it works perfectly, but from my phone, i just get a timeout. I figured i needed to open the port (8090) in my firewall and spent some time setting that up, but it still won't work. I am using my computer's IP address on the network: 192.168.1.214:8090, which should reach the same place as 127.0.0.1:8090 from the computer.
I then set up a Spring boot application to listen to the 8090 port and i was able to reach that from the phone just fine. This suggests that the firewall is not the issue. I can trigger the control my Nikon URL from within the Spring boot application too, by making a call to http://127.0.0.1:8090/?c=3. I can also reach pages served by Apache (192.168.1.214/testpage.html) on the computer from the phone without any problems.
What am i missing here?
The Nikon software is probably binding itself to the 127.0.0.1 network interface and not every network interface it finds.
The software doesn't appear to be designed for network control but just runs a web server so it can present a UI in HTML.
You would need to change the Nikon software so it listens on other ports (or configure port forwarding or a reverse proxy).
I am creating an app in which i have to access four cameras installed at different locations on my iPhone. After googling for some time i found that it will be done with http live streaming but i am confused at all about from where to proceed.
I would appreciate any help in the right direction.
Regards,
Note, you can not get access your cams without static ip on cams. You can use vpn server, and connect cams and iphone(I dont know exactly about connecting iphone to VPN) to this server, and make routes between device. So, here you can perform some operations on server
I wrote a small application which needs access to Google API with OAuth2 and which is typically run on maybe a Raspberry Pie to reduce power consumption since it needs to run pretty much 24/7. The device my application runs on is typically connected a LAN at home.
The user controls the application using a web interface from a PC/Tablet/... in the same network. However the web application is reachable from the LAN only, it cannot (and should not for security reasons) be accessed over the Internet, because it hides behind a NAT and/or a firewall.
The documentation states that I have the following options:
Web server applications
This forces me to use a redirect URL which must be known in advance. Since my app is most likely accessed by a dynamic private IP address, there is no way I know the URL in advance.
Installed applications
Yes, that would work. I just need people to copy and paste the returned code into a web form of mine. However that is somewhat uncool.
Client-side (JavaScript) applications
This does not give me a refresh token which I totally need.
Applications on limited-input devices
Polling? Well... If it works... However it requires the user to match a code shown on the device with a code displayed in the webbrowser. If I use that I can just as well ask the user to copy&paste the code returned by the installed app mode.
As far as I can see the copy&paste the code with installed app is my best chance. Is it really? Or is there is possibility to get along without that bit?
I'm currently developing a simple multiplayer game app for Android and I need to have a server to which the users connect to.I'd like to set up this server at home. I have a dynamic IP address,so someone told me I'd have to set up a local DNS server or something like that. I'm not even sure where to start with setting up a DNS server, everything I found was for windows 2003 and linux. Nothing for XP? If any one can shed some light on this matter, explain a bit how setting a DNS works or supply a link with "setting up local DNS for dummies" I'd be grateful.
Also, besides setting up a DNS so I can find the server every time, how about the communication with it? I'd like for it to be as secure as possible. Another friend told me something about communicating via SSH, which is again something I am not accustomed to.
So if someone could explain some of these concepts or offer some GOOD link for that that would be great. I'm very confused :)
Thanks
EDIT
Btw, the server is in Java and currently i'm communicating from Android emulator to the server (which is localhost) via sockets.
That's not a simple thing you're trying to achive. First you have to create your own server on your machine (maybe you're done with this step), then you have to make this server available for everyone. At this point, I suggest the DynDNS service:
http://lifehacker.com/124804/geek-to-live--how-to-assign-a-domain-name-to-your-home-web-server
A local DNS by default help you to find your own servers by name instead of IP address, but if you have a usual internet service with dynamic IP, you need an external DNS provider to route your clients to your server. (read the link above for the full explanation)
About the SSH security: Yes, you will need some security settings indeed, but that could be a very hard problem sometimes. You can set your server to work with SSL sockets, which is a part of the core J2SE release. It will work against some sort of attack, but none against others. Running your own server will raise unexpected numbers of problems, prepare for that.
As already stated in the comment to your post, something like http://www.no-ip.com or http://www.dnsdynamic.org would solve the issue with your dynamic ip - You do not need a local DNS server.
With regards to communication, i believe that SSH is linux/unix only. Since you wish to use Windows for the server, FTP or Remote Desktop would be best. Choose FTP if all you want to do is manage your files, choose remote desktop if you wish to manage your entire computer. I've had good results with the FileZilla FTP server on windows (http://filezilla-project.org/)
With that said, i think you would be better off buying a simple and cheap hosted service instead of using your own computer - you can get something that can run your java app for $5/month some places, and compared with the annoyance of having a local server running in your house, it might be worth it.
I am currently on a mac using the pre-installed Apache server.
Now I need to cross-browser test some websites, and therefore I need to access my pages on some other computers. How can I make my localhost-sites accessible for other computers on my WiFi (without uploading to another server)?
Thanks in advance.
Apache server's default configuration should allow other computers (even ones not on your local network) to access whatever it's serving up.
You can access your server from another machine by using the IP address of your server. You can find the IP address of your server by finding a console (this works in Windows and Mac machines) and typing in "ipconfig". (For linux machines, it's "ifconfig".)