NordVPN-switcher icon indicating copy to clipboard operation
NordVPN-switcher copied to clipboard

Problems with conection

Open tiago199988 opened this issue 4 years ago • 4 comments

Sometimes Nord gets stuck trying to conect. is there any way add like a timeout function. Like for example after 10 secounds if no conection is made retry to conect to a new server.

tiago199988 avatar Feb 07 '21 14:02 tiago199988

Hi Tiago, thanks for using nordvpn-switcher. The thing is, there is a timeout built into the script right now, but for some reason it doesn't seem to work all that well for some people. I'll doublecheck the script and see what I can do!

kboghe avatar Feb 07 '21 16:02 kboghe

👍

tiago199988 avatar Feb 07 '21 23:02 tiago199988

Hi, I think i found the problem. But don't know how to solve it. Once you get an error while connecting it causes for some strange settings when you check nordvpn status: ~$ nordvpn status Status: Disconnected Current server: se424.nordvpn.com Country: Sweden City: Stockholm Your new IP: 91.132.138.203 Current technology: OpenVPN Current protocol: UDP Uptime: 2 minutes 35 seconds

It shows disconnected but also shows it is connected. When you do this normally it only shows: ~$ nordvpn status Status: Disconnected

I don't find a way to remove it from the nordvpn status. Doing another disconnect does not help.

jochenboele avatar May 08 '21 21:05 jochenboele

Hi, I've made a code to manage this issue, @kboghe if you have time you can include it in nordvpn-switcher, the idea is simple, using the timeout command in Linux,

  • sorry if the code is not organized, I'm not using github much, you can find attached a screenshot of the code image
for _ in range(10):  
	connect_cmd = "timeout 10s nordvpn connect " + random.choice(countries)  
	os.system(connect_cmd)  
	vpnStatusOutput = subprocess.run(['nordvpn', 'status'], stdout=subprocess.PIPE).stdout.decode('utf-8')  
	if not "Disconnected" in vpnStatusOutput:  
		break


marrakechi avatar May 09 '22 08:05 marrakechi