how to configure/setup SSTP-Client in OpenWRT - openwrt

How do I setup my OpenWRT router to route everything through sstp-client?
I'm currently using OpenWRT on my router to route everything through a secondary shadowsocks server on my phone.
And I'd like to switch to using the hotspot app's sstp vpn directly,
instead of using the separate server app on my phone.

Related

Is there a workaround to configure host to address mapping on hosts file on iPad?

I need to connect to a work remote server via work VPN (the server is web GUI so connection is via https) which requires hosts resolution, meaning I have to configure the host name and map to the IP address in the hosts file. This is how I connect to the remote server on my Mac.
I just got a new iPad 2020 and I will like to connect to the server on my iPad.
For me to access the hosts file on iPad, I will have to jailbreak of which I don’t wanna do that. I’ve read counts of articles online on how to go about using some other apps, but it only works for if your server and your device are both on thesame network and VPN is not used.
Appreciate if there is a workaround for me to do this:
I need to connect via work VPN;
Access the server using the host name on safari etc.
Thanks.

Connecting to localhost via iPhone while connected to a hotspot

I need some help accessing a server that I have running on my mac. So basically my setup consists of mac on which I'm running my server and also using XCode to run the app on an iPhone connected via USB. And then both this iPhone and the mac are on the same wiFi network which is a personal hotspot that I have running on a different iPhone. I'm trying to access localhost from the iPhone by basically using my mac's IP address and the right port: http://IPADDRESS:PORT/, however this doesn't seem to work. Any ideas as to what may be going on here and potential workarounds or solutions. Connecting to a non hotspot, traditional wifi network is not an option at the moment.
Thanks!
This will work if you have it set up correctly; I am doing it right now. Remember that you have to bind the server to 0.0.0.0 — not 127.0.0.1 — if you want to connect from non-localhost IPs. Also check your system firewall.
If you're still having trouble, Tailscale is another solution that may help — https://tailscale.com
I suggest you take a look at using ngrok as a solution, this will create a secure tunnel and expose the service running on your Mac through a url.
You'll need to create an account and retrieve your auth token.
You can then install it using Homebrew by running in Terminal: brew cask install ngrok
Once installed, connect your account by typing into Terminal: ngrok authtoken [auth_token]
To start a tunnel, type into Terminal: ngrok [protocol] [port number]
For example, to start a tunnel to a HTTP server running on your mac: ngrok http 80 (or ngrok http 443 for HTTPS)
If its a custom TCP protocol use: ngrok tcp [port] (or ngrok tls [port] if using TLS)
This will then give you a URL to use in your app. On free accounts, the URL will change on each restart, paid accounts get a static URL option.
If you don't have Homebrew, download it from and follow instructions on: https://ngrok.com/download

Cannot load site on localhost with iOS devices on BrowserStack Automate

I'm hosting a .NET Core HTTP application on localhost using Kestrel on an available port for some browser-based UI tests, but when trying to access it using real iOS devices with BrowserStack Automate with BrowserStackLocal.exe, Safari consistently refuses load the page.
I've tried various parts of the IP ranges documented here, but none have been successful. Desktop browsers (Chrome, IE, Edge and Firefox on Windows, Safari on macOS Mojave) and real Android devices work as expected.
I've also tried using the local IP address of the machine and the fully-qualified domain name (FQDN) as described here, but neither work portably as Windows Firewall blocks the connections even through BrowserStack Automate can resolve the address.
Port 80 is not a viable solution as developers' machines will have IIS running on their machines using that port, so it is not available for other purposes.
Given the following constraints, what are the workable solutions?
Hosted on HTTP.
Runs without admin privileges (i.e. no reconfiguring the firewall or using privileged port numbers <1024).
At least two possible port numbers to use so that if one is in use there's at least one alternate to try.
No additional manual setup required to run the tests (should just be the command dotnet test).
On the iOS devices, try resolving http://bs-local.com:5000 instead of http://localhost:5000.
You can access the site using http://bs-local.com:5000, But make sure to disable the host check for webpack using disableHostCheck: true in configuration.
For angular cli users, to disable to the host check you need to use --disable-host-check like ng serve --port 4200 --disable-host-check
This is from BrowserStack's support:
a) On Safari
Previously, accessing local websites with 'localhost/127.0.0.1' in the URL was not supported on iOS devices running iOS versions 10 and above.
However, to make sure that your website loads with 'localhost' in the URL, we now modify the URL to http://bs-local.com on these devices. This helps in loading your website in an expected manner. The same is mentioned here.
In the screenshot you've shared, you can see the redirection to bs-local.com as well.
It seems that your localhost website is configured to be accessible only via specific hostnames such as 'localhost'. Thus, you face the reported error.
To be able to test your localhost website via Safari on iOS devices, I would recommend configuring your localhost website to be accessible via the private IP address of your local machine.
Once done, you can access your localhost website as http://<private_IP_address:port> and this should work.
I would also encourage reading through this guide to understand how you could achieve the above: https://www.notion.so/Testing-localhost-on-iOS-devices-1ceb5e274cee46d7ac538b71304919b4
b) On Chrome
Due to restrictions imposed by Safari, testing localhost websites on Chrome is not supported by default on iOS devices.
The problem arises with the usage of the domain 'localhost'. We are actively trying to find alternatives for this behavior as well.
However, in the meantime, you can access your localhost website via the private IP address as mentioned above via Chrome browser on iOS devices as well.
Once you make the necessary changes to your configuration to allow your localhost website to be accessible via the private IP address, you can test your localhost website via Chrome on iOS as well.
Feel free to reach out should you need any further assistance!
Note: The private IP address is not the same as 127.0.0.1. You can use this article to identify the private IP address of your machine.
Regards,
Reehan
BrowserStack Support
Did you try changing the 'localhost' with the IP address of the machine (where the web is hosted)?
For instance - If the IP for the machine on which application/webpage is hosted is 22.22.22.22, then change http://localhost:3000/index.html to http://22.22.22.22:3000/index.html in your test
They have mentioned the same here - https://www.browserstack.com/question/663
If you are using Angular CLI then please run command
ng serve --host 0.0.0.0 --port xxxx
This will make sure that you would be able to access application using your IP and port specified. Once done you should be able to access your application using browser stack iPhone device browsers using IP and port rather than localhost.

testing mobile apps at home (IIS hosted)

I am not sure what to look for with the current problem and I appreciate your suggestions.
Basically, all I want to do is locally host a web application on IIS and access it from my mobile browser.
My web application is hosted on the local IIS and works fine on the main machine. I can use my computer name, internal ip or external ip instead of localhost to connect to the app from the main computer. But when I go to another computer (which I can see and exchange files with) connected to the same network I cannot access the web application on the main machine. I tried ip and machine name.
At work, we are connected to a Domain and I tried the same thing with the work computer. When I write my computer name or it's ip, I can access hosted app from another computer.
So the question is, do I have to have a domain for this capability and if so, Is it possible to create a local domain at a home network? What do I need to search for to get this working? Is WAMP a must?
Apparently opening the outbound/inbound port 80 from windows firewall is enough

Connect to local web service (running under MAMP) from iPhone via WIFI.

I have setup a local REST webservice with MAMP.
I have setup a virtual host with the url "http://aem.davidcasillas" pointing to my public folder.
MAMP is listening on port 80.
If I access via Safari to "http://aem.davidcasillas/webservice/rest/getEventosToday" I get the correct json data.
Now I'm trying to access this web service from my iPhone application. I run it from XCode into the device.
The device is connected to my local network via WIFI, and the connection is working (I can load webpages in safari)
I'm using RestKit to download the data and I'm trying to reach it with the same url I use in my Mac: "http://aem.davidcasillas.es/webservice/rest/getEventosToday".
In the device I get the error:
NSURLErrorDomain -1003 Found no server for the specified host name.
How should I write my url so I can reach the web service from the iPhone?
NOTE: I have read this post: test local websites with mamp on iphone? but none of this problems apply to my case. I have firewall disabled and my config.ini file shows the following listen line:
Listen 80
I have found a workaround.
I use the WIFI ip address in SystemPreferences->NetWork in my Mac and then the whole path to the resource, so instead of:
"http://aem.davidcasillas.es/webservice/rest/getEventosToday"
I am writing:
"http://192.168.1.6/aem.davidcasillas.es/public/webservice/rest/getEventosToday"
The 192.168.1.6part takes me to my local installation root folder /Applications/MAMP/htdocs/.
In the rest of the path I have to put the whole path to the resource. Notice that I have to include the public folder in the path. Hope I could use my virtual host setup, but have not found a way.
When I run hostname, it prints out
> hostname
ddopson.local
You can edit this in System Preferences ==> Sharing ==> Computer Name(text box at the top). Note that in the "computer name" textbox, I filled in "ddopson".
If you are on WiFi, you should be able to connect to that hostname (ddopson.local) from your iPhone. This works because both iOS and your Mac support Multicast DNS where a multi-cast UDP packet is emitted onto the L2 network to lookup local hostnames. When your Mac hears this multi-cast packet, it will reply to your iPhone with its ip-address and off you go.

Resources