Comments (9)
Mặc định openvpn sẽ retry vô hạn. Nhưng chương trình này chỉ cho kết nối lại tối đa 3 lần nếu lỗi ở server vpn.
Còn những lỗi ở máy bạn hay do đường truyền bị ngắt thì chương trình sẽ dừng luôn nhé.
Việc thử lại quá nhiều lần sẽ dẫn đến nguy cơ bị block ở proxy hay firewall.
Số lần retry tối đa
vpngate-with-proxy/vpnproxy_tui.py
Line 116 in 3a2b067
Code check điều kiện retry khi kết nối fail. Nếu không thỏa cái if
này thì sẽ dừng kết nối.
vpngate-with-proxy/vpnproxy_tui.py
Line 552 in 3a2b067
from vpngate-with-proxy.
Hi @partisansb
You would start here
vpngate-with-proxy/vpnproxy_tui.py
Line 489 in 3a2b067
Add your setting to the file before writing it out to .ovpn or before the OpenVPN is called.
from vpngate-with-proxy.
can someone write me a script that automatically reconnects if the connection is lost like vpngate client after a while?
from vpngate-with-proxy.
hi @bomayso
Just add your option here
extra_option = ['keepalive 5 30\r\n', # prevent connection drop due to inactivity timeout
'%s' % ('connect-retry 2\r\n' if self.proto == 'tcp' else ''),
'resolv-retry 2\r\n',
]
The options that control the reconnection are the followings:
--connect-retry n [max]
Wait n seconds between connection attempts (default=5). Repeated reconnection attempts are slowed down after 5 retries per remote by doubling the wait time after each unsuccessful attempt. The optional argument max specifies the maximum value of wait time in seconds at which it gets capped (default=300).
--connect-retry-max n
n specifies the number of times each --remote or <connection> entry is tried. Specifying n as one would try each entry exactly once. A successful connection resets the counter. (default=unlimited).
from vpngate-with-proxy.
Bản thân script này đã có chức năng ý rồi hả bạn, tại test thử ngắt mạng đi thì không thấy nó tự kết nối.
from vpngate-with-proxy.
Hi, I've customised your cli script so it can run int he background automatically at start up.
I'm not so familiar with the python code you have used so how would I go about adding it...
I tried :
vpn_file = vpn_list[ranked[chose]]."/nredirect-gateway def1".write_file()
But it didn't work...
Thanks for your time, I've been using this script for a long time now and love it, just want to make it work better for me, thank you.
from vpngate-with-proxy.
hi @partisansb
You could try to add your line here
extra_option = ['keepalive 5 30\r\n', # prevent connection drop due to inactivity timeout
'%s' % ('connect-retry 2\r\n' if self.proto == 'tcp' else ''),
'resolv-retry 2\r\n',
'redirect-gateway def1\r\n' # <--- added gateway redirecting option
]
from vpngate-with-proxy.
Sorry in the delay getting back to you. I'm getting getting a connection and the script runs without errors, but my vm's are not getting a browser connection though it... Where can I check the .ovpn file thats being made?
Thanks
from vpngate-with-proxy.
This is working as it should thank you
from vpngate-with-proxy.
Related Issues (20)
- Bug: Taskbar indicator -> show main HOT 3
- how to get server list? windows and linux difference server list? HOT 1
- Aur version for arch would be great
- iptables rules that block non-VPN traffic HOT 1
- Linux Mint Issue HOT 2
- Please add SOCKS5 Proxy support
- [feedback] Python3 thanks. It works HOT 2
- unexpected exit after changing country at cli HOT 3
- Network and Proxy Problem HOT 4
- Cannot connect to vpngate mirror sites HOT 5
- Cannot Open TAP/TUN Archlinux HOT 1
- Fix vpn_indicator' vpn status "Season:" -> "Session:" HOT 2
- No server certificate verification method has been enabled HOT 1
- Replace default cipher in downloaded vpn config to stronger chiper HOT 1
- Vpn got error, terminated Restore dns HOT 5
- Run Open VPN as a different user HOT 1
- Cannot connect to vpngate mirror sites HOT 3
- failed to get VPN servers data HOT 1
- OpenVPN 2.6.3 not support default old AES-128-CBC data chipher
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vpngate-with-proxy.