Accessing local computer in browser with company domain suffix - ios

I am running web server for my application (Angular) on my work laptop and whenever I want to access it from my laptop I have to go to https://localhost.company.com:8000/ so that my login cookies are sent to my local proxy server that communicates with development server. This works fine, but I need to access this local server from iPhone devices, but it seems that they don't recognize URL as local IP with suffix. So when I enter https://192.168.1.100.company.com:8000/ it won't find the server. It will find the server if I omit the .company.com, it will load the index file served by server, but it won't send cookies to my proxy endpoint and therefore the app is not working.
Is there a way to access this local server with cookie sending on iPhone/iPad devices?

Related

Can I use my own device as redirect URI with OAuth2

I'm building an application in a device (Point of Sale) and for this I need to use OAuth servers to authenticate a webservice request, the guys on the side of the webservice are now asking me for a redirect URI, I do not have any experience on this so I started googling around 'redirect URI's, so now I wonder, given that this app works on a device (not on cloud), is there a way I can use my own device as the redirect URI and catch the webservice response there (such as the JSON)?
Extra info it might work (or not): In my office we all use DHCP but we have a configurable server.
Thank you.
It is possible to redirect to your own device if it is running its own web server.
This is because the redirect URI is passed back to the requesting client's browser which performs the redirect as shown in the diagram below from this tutorial. From there the browser can redirect to a local device's web server using the following approaches:
Use localhost or the 127.0.0.1 loopback IP for the redirect URI. This will work in the client's browser but not all services may allow registering a redirect URL to localhost or 127.0.0.1.
Use an external host which is mapped to the local system. On a Linux system, this can be configured by placing the hostname the /etc/hosts file and pointing it to the local system loopback IP address, e.g. 127.0.0.1. This can point to a real server on the Internet which is just redirected on the local system so this approach can be used with any service.
An example /etc/hosts file can contain a hostname like example.com which is then used in the redirect URI.
127.0.0.1 localhost example.com
Read more about localhost and the loopback IP address on Wikipedia:
https://en.wikipedia.org/wiki/Localhost
Diagram courtesy of TutorialsPoint.com.

Creating HTTPS server in iOS device

My requirement is running a HTTPS server on the device it won't connect to the external clients. Both client and server is my application only.
For example, if there is a request https://myip/getUserData from my app, my app fetch information from core data and returns to the client(that is also my app)
I was able to create an HTTP server in my app following the below link. but I want the same in HTTPS. That means to run the HTTPS server.
http://www.cocoawithlove.com/2009/07/simple-extensible-http-server-in-cocoa.html

Redirect Users if they try and access the application on the wrong server

I have an MVC application, and my company has their own web servers that we publish to. Now, this application is on server x.. but I have since published it to a new web server (server y). If user's try and access the application on server x, I need them to be transferred to server y... or at least give them a message stating to go to the new URL.
Is there a way I can do this within IIS Manager on server x?

video doesnt load in wkwebview using Secure CocoaHTTPServer

Below snapshot has 2 wkwebviews in the iOS app.
Upper part - wkvebview1: loads html page from locally hosted secure CocoaHTTPServer on port 51092.
Lower part - wkvebview2: loads http url from locally hosted CocoaHTTPServer instance on port 51091.
Images loads fine in both wkwebviews. Not able to load video with secure webserver.
Is there any known limitation for wkWebview in iOS10 for video using secure webserver?
Sample iPhoneHttpServer Github link
SSL/TLS security requires a certificate that's valid for your server's hostname; by default, a WebView will not load content from a TLS server that cannot present a valid certificate. This makes secure mode for the HttpServer class essentially useless, as iPhones do not have stable public hostnames, and it is impossible to obtain a valid certificate for localhost.
In any case, enabling secure mode on a server running locally is hardly necessary; traffic to that server is local to the device, and cannot be intercepted.

Provide access to a development web server running on laptop connected via iOS Personal Hotspot

I'm developing a web service that needs to connect to another web service and register a web service endpoint that notifications can be sent to.
e.g. Server A sends a registration request to Server B, containing the URL on which notifications will be sent (HTTP PUT).
If Server A (the development server) was on a public IP, all would be well, but at the moment its on my development laptop which is connected to the internet via a Wifi router which connects to Personal Hotspot on my iPhone. This is actually the most useful internet connection I have available most of the time. Neither the router nor Personal Hotspot (AFAIK) allow port forwarding or DMZ.
For development purposes I would like the notifications to come through to the service under development on my laptop. I can specify a static IP address when registering with the third-party web service, and a specific port number if needed.
My only thought was to use a VPN connection from the laptop to the internet, therefore masking the existence of the inbound route.
The VPN would therefore need to allow inbound packets through to the server. I've looked at the VPN service by VPNUK.info who I currently use, and they have both a dynamic IP and static IP version of their product, and the static version seems to suggest that inbound is possible.
Can anyone suggest how or if this would work? Any specific setup instructions? I presume once the VPN is established, and requests to the VPN Static IP address will be handled by the server on the development laptop (which is the device starting the VPN connection).
The development laptop is a Macbook running OS X Yosemite.
The web server is built using Node.js and Express.
I ended up signing up with VPN UK for a dedicated static IP VPN service. This gives a single publicly accessible IP address to the VPN connection.
Once the Macbook establishes the VPN, any requests to that IP address are routed to the Macbook as requested, so it doesn't matter where its located or the type/complexity of the internet connection.

Resources