Connect to the Wi-Fi network from within the app without internet access - ios11

I am developing hotspot helper application which tries to connect to the captive network after connecting to it, I need to handle the authentication within the app.
Approach 1
I used NEHotspotConfigurationManager in order to programmatically connect to the WiFi network and it works great. The problem i am facing is after connecting to the captive network iOS does not send the request to the connected network until the connected network has internet access or I manually go to the settings and it pops up the web page for authentication and i click cancel and select use without internet.
Approach 2
Second approach i used is by using NEHotSpotHelper as described in this tutorial
In this approach when I receive the commandType authenticate it does not send request to the Wi-Fi network (If the device is connected to the 4g the request goes over it otherwise it returns internet connection appears to be offline)
So how can i authenticate the user from the app after connecting to the WiFi with limited access?

I found that developer need to bind the request with the received command before making web request to the connected network. All you need to do is to make NSMutableURLRequest and then call hitTestURLRequest.bind(to: command) because bind function is defined in the category of NSMutableURLRequest.
Related question: https://stackoverflow.com/a/50753526/1796092

Related

Localhost and Ionic View

I am testing in my browser using Ionic Serve and I am also connecting to a RESTful WCF Service running on a Localhost. I want to be able to connect to that service using the Ionic View App. Is it possible to connect to a local host with an external device like using Ionic view app on my device or do I need to host my service differently?
computer and device on same network
goto computer command prompt and run this command ipconfig
you will get internet ip address like e.g:192.168.0.102
now move to your device set http:// 192.168.0.102:yourapilink?parameters=1
please like if answer really helpfull
There are tools available, but most easy way will be this:
Make sure both computer and mobile are on same network.
Run server on localhost, and in client side code replace localhost with the IP address of your system where you are making api calls. For example localhost/api/login with 192.168.1.102/api/login.
Now your mobile will be getting response from server running on your system.

Ionic framework - detect internet connection

I am developing simple application using Ionic framework (and AngularJs) that fetches json data from my webpage. How can I detect is there "internet connection" and display message to user: "Connect to internet" if not.
EDIT
Can I use cordova API for that ?
Cordova provides org.apache.cordova.network-information plugin.
See documentation HERE
This plugin provides an implementation of an old version of the Network Information API. It provides information about the device's cellular and wifi connection, and whether the device has an internet connection.
If I am not mistaken, this plugin only detects whether the Wi-Fi or Cellular networking is enabled on the device. This does not always mean that the application can actually reach your remote server, if you are connected to the WiFi network without internet connection.
Therefore, the only solution I have found to ensure that the application can reach your remote server is to continuously ping the server.

How does the common networking application (using unix socket API) accomplish to forward its port, with the computer connected to a internet router?

Do you happen to know common application using unix socket api doesn't work on computer connected to internet router? For example, assume that there is a computer that is running a simple web server using socket in C. when a web browser in another remoter computer send a request, the web server cannot send a response to the request since its port is closed by the internet router(?) (Of course, there might exist another reasons).
However, the common applications by a competent developers works well. For example, utorrent client receives a request for some data from peers and responds to the request well, although a computer that is running utorrent is connected to the internet router. Does utorrent adjust router configurations using some system calls? If not, how does it upload the some data?
So my question is that
how does common application using socket API accomplish to forward its port, with the connection to the internet router?
How my program in C accomplish to forward its port with computer connected to the internet router?
Thank you in advance.
If you're connected the internet through a NAT router, in most cases any unsolicited connection into the router from the WAN will be refused. What you need is to tell the router (in some way) that unsolicited traffic coming in on a specific port number or range is to be accepted, and forwarded on towards a specific local IP address. This can either be done manually in your router's configuration, or if your router supports UPnP you can use that protocol to configure port mapping for the traversal of the router.
They don't. To send and receive data on the connections your program has started it's not needed. Port forwarding needs to be done by hand by the machine administrator and is only required to receive new connections.

How to monitor external traffic to my local IIS server?

I'm developing for mobile devices and to debug I connect devices on WIFI to my IP address. It works well for developing on hardware and debugging on my machine. The only thing I can't make to work is how do I set up Fiddler so it sees traffic coming from external clients?
If I open my site from browser on same machine - fiddler get's it. But when I connect to my PC by IP address from another machine - fiddler doesn't see it.
I have proper settings (I think)
You need to configure Fiddler as a reverse proxy. See Using Fiddler as a Reverse Proxy.
I got this to work by simply changing the IIS Application Pool whose traffic I wanted to inspect to run under my identity, since Fiddler seems to only capture traffic of the logged in user by default. Just make sure your user has all of the necessary permissions required by IIS; I'm an admin so this wasn't an issue for me. And of course, don't forget to change the IIS Application Pool identity back when you are done.
The other option of course is to instead log in as the user that the IIS Application Pool is running as (if it's not a service account like Network Service) and then run Fiddler while logged in as that other user.

Tunneling a mobile web server using a proxy server

I have a mobile webserver, which is connected to internet through GPRS. ISP only provide a private IP, so is not possible to access to it using something like no-ip or dyndns. Is there a way to use a proxy server to access to this mobile webserver?:
Mobile webserver stablish connection with proxy server
a web browser (client) stablish a connection with the proxy server, and redirect the stablished socket directly to mobile webserver
I need to have several of these type of mobile web server (each with a different hostname) connected to a proxy server (ie. its domain is myproxy.com), and provides to a normal user a web site in mobileserverlist.myproxy.com with a list of links, each link will point to ie
http://mobilewebserver1.myproxy.com
http://mobilewebserver2.myproxy.com
http://mobilewebserver3.myproxy.com
here the proxy server will redirect traffic to each mobile web server (all of them in private networks)
ideas?
You mean you have for example a mobilephone as a web server. You can't get a static ip adress and even no dyndns domain. That you can't get dyndns domain is surprising. But you dont really need a proxy. You can easily set up a request script, that direct your users to the location you want.

Resources