isontheline / pro.webssh.net

iOS / iPadOS / macOS SSH Client
https://apps.apple.com/us/app/id497714887
MIT License
276 stars 31 forks source link

Tailscale : VPN On Demand #1123

Open isontheline opened 1 month ago

isontheline commented 1 month ago

Feature description

Hi,

first of all, you’ve made a great product and i bought it pretty quickly after testing. Recently i changed to Tailscale, to access everything from the iPhone/iPad. Basically it’s a VPN and there is an option to enable on-demand VPN. Everytime the DNS name of any device in tailscale is called, it will open the VPN connection. For example device.random-networkname.ts.net is called in the browser, it will connect the VPN and connect to the service. With WebSSH it’s not working, it says the IP address couldn’t be resolved. I’m not 100% sure, but this could be because you are using a different DNS resolver as used within the system. Could you check that and if possible add a switch to use the systems one?

Best regards, Simon

isontheline commented 1 month ago

Hi,

it’s sadly not working. But based on your code i found some documentation: https://developer.apple.com/documentation/network

It says resolving DNS and connecting to the IP is not working with VPN on demand. The URLSession or Network APIs must be used: image

I think the URLSession thing just supports HTTP(S), probably the NWProtocolTCP would support SSH connections (https://developer.apple.com/documentation/network/nwprotocoltcp) but i don’t want you to change all the code for this :D It’s easy enough to create a Shortcut which connects the VPN and opens WebSSH after that ;)

Best regards, Simon