View local development server on USB-connected iOS device - ios

I have my OS X development laptop hooked up to the net via an iPhone 5 connected with USB (Personal Hotspot). With a web server running locally for my development work, can I load pages from this server on my iPhone and then inspect them with Safari's Web Inspector? I have tried 127.0.0.1 and my connected IP public address but no success.

It is possible to do this - it just required a bit of investigation as to how the networking is arranged when using an iPhone via USB with Personal Hotspot. There are two steps:
Firstly, using USB, the USB port is setup as a network interface. The precise (and technical) details can be seen with ifconfig however what you need to know is what IP address is used for the USB interface.
Go to Network Preferences and select the iPhone USB on the left hand side. You will see a message like iPhone USB is currently active and has the IP address 172.20.10.2. Note that this is not the publicly available IP address, it is the network interface on the Mac. This is the ip address you need to type into the browser on your iPhone to see your local development server.
Secondly, you need to make sure that your local development server is serving the USB interface. This will obviously vary depending on your server but typically there will be a HOST parameter that directs the server to bind to that IP address. Again, use the IP address you found above to instruct the web server to serve pages on that IP.

Related

Can grpc communicate with mac address insted of ip

Currently my program use the IP of the other device in order to communicate over grpc.
Unfortunately the IP is changing all the time and I cannot continue the connection between the devices without updating it manually.
The connection between the devices is only on LAN and should blocked access from WAN.
Locking the IP of the device in the rowter settings is not an option this time.
Does grpc have a way to communicate over LAN (inside my network) using identification number or mac address that does not change over time?.
Related questions I found:
grpc: Identify clients from same IP address
Reason for both a MAC and an IP address
In order to locate a machine based on its MAC address, you are talking about implementing ARP. This is something that is not supported in dart nor am I sure it would be advisable to go this route anyway. If setting a DHCP reservation on your router is not an option, are you able to skip DHCP and set a static IP on the receiving machine?
You could look into dynamic DNS which your router may support, or you may need to set up separately, but that will also require a static IP (for your DDNS server). If your machines can connect to the internet there are many DDNS services you can sign up for, but it sounds like that is not the case.

Can I connect from an Android device to my router from anywhere (outside of LAN - not hosted database)?

TLDR: i'd like to connect from a mobile phone app to a database on my RPI from anywhere on the world. Is it possible without hosting an URL or udpating the IPs in the app and being it free?
Longer version: if I set a static local IP to my RPI, can I somehow connect to the router from anywhere on earth via the internet? I'm making an app for employees to log their work around our country and I would give them out the .apk to install, so I'd like to make it always working (even if router restarts, etc). Is it possible via code (C#) or is there a free service that could allow me to do it? (service to set a global static ipv6 to RPI?)
You can use https://ngrok.com/ or https://localtunnel.github.io/www/ (The default server for this is down these days) on your raspberry pi to receive a URL for a web service hosted on it.
If your router gets a public IP from your ISP, you can configure port forwarding on it to your raspberry pi, such that it forwards all connections to router-ip:port -> raspberrypi-localip:port and use a dynamic dns service like http://www.duckdns.org/ to give a "domain name" for your router instead of using the IP.
There are a lot of ways to do this really, but i say look into ngrok or if possible, the dynamic dns approach.

Identifying WiFi clients connected to ESP8266

I'd like to know that a specific device (phone/tablet) has joined my WiFi network created by ESP8266 microcontroller. It shouldn't require any installed apps on that phone/tablet, if possible, to simplify the whole setup.
So I think I need to somehow identify connected clients, and MAC is not an option because it is subject to change randomly on, say, Apple devices.
Maybe it's possible to collect host names of connected clients?
I know that Windows and Ubuntu clients send their host names when getting IP from DHCP server (see here). Also, it's possible to find such information on, say, home Wi-Fi router admin web page (i.e. host names, their IPs and MACs).
I'm running DHCP server on ESP8266, but I haven't found any API that allows to get peer host name (i.e. reverse DNS). Does ESP8266 support getting such information?

Accessing remotely my web service

I have implemented a web service on my mac and I am able to access its functionalities through the url "http://localhost:8080/ServiceApp-war/resources/".
As I got satisfying results that I could see in the iPhone simulator in Xcode, I decided to connect my iPhone and test on it. But for this to work I think I need to change the "localhost" in my URL to the IP address of my mac.
I tried to replace it with my public IP address and I got a "could not connect to the server" error on my console. I also tried to replace "localhost" with the IP address I found in System Preferences-->Network-->Wi-Fi and I could see that it was working on the simulator but still nothing when I connect my iPhone and run the application on it.
Please provide a solution for accessing my web service remotely.
Thank you.
Create hotspot from your mac, connect to it with your iPhone and try again.
<lame solution>
Try some service for temporary domain, it will make your computer accessible from anywhere.
How do you "connect" your iPhone? USB connection does not create a network. Well, it does create if you turn on Personal Hotspot on your iPhone (maybe in some other cases, dunno). But the most simple way is to connect Mac and iPhone to the same WiFi network.
Once connected, you can use any of "ping" apps available on App Store. Just look for "ping" (some kind of "network reachability test" or so). You can check if your Mac is really reachable on the network.
If it's not reachable, check your network settings on both devices: do they belong to the same subnet, do they use the same gateway, etc.
If your Mac is reachable with ping, then you should deal with your web service. I setup the web server (which is already distributed within OS X): it already has all the settings to allow other devices to connect. But your web service may require some additional setup. It's two basic things: it should bind to your IP address (please check http://YOUR.IP:8080/ServiceApp-war/resources/ from your Mac!) and second, accept incoming connections from other agents, you should find it somewhere in its settings.
Ngrok was the perfect solution I was looking for.
https://ngrok.com
You could also try finch, which is similar to ngrok. It has a nice friendly GUI. https://meetfinch.com

Does blackberry API allow blackberry to connect to desktop via TCP/IP?

Wondering how to connect blackberry to desktop or the other around via tcp/ip? I assume both the desktop and the blackberry are connecting to the same router.
If I read your question correctly and you want a TCP connection over a WiFi router on the same LAN as your desktop, then from your BlackBerry app you simply do:
javax.microedition.io.Connector.open("socket://<your desktop's IP/hostname>:<port>;interface=wifi");
(you can replace socket:// with tls:// ssl:// for a TLS or SSL3 socket connection)
If you're going over the cell network the situation is a bit more complex - you'll only be able to connect to your desktop if your device is attached to a BES on the same LAN as your desktop, or if your desktop has a public IP, but the basic syntax is the same (minus the interface=wifi obviously).

Resources