Skip to content

Commit

Permalink
improve stability of finding server port
Browse files Browse the repository at this point in the history
  • Loading branch information
Dragon2fly committed Nov 6, 2015
1 parent 06e40eb commit e3e62d3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions vpnproxy_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
__author__ = "duc_tin"
__copyright__ = "Copyright 2015+, duc_tin"
__license__ = "GPLv2"
__version__ = "1.0"
__version__ = "1.20"
__maintainer__ = "duc_tin"
__email__ = "[email protected]"

Expand Down Expand Up @@ -58,7 +58,7 @@ def __init__(self, data):
self.proto = 'tcp' if '\r\nproto tcp\r\n' in self.config_data else 'udp'
port = re.findall('remote .+ \d+', self.config_data)
if not port:
self.port = 0
self.port = '0'
else:
self.port = port[0].split()[-1]

Expand Down
5 changes: 2 additions & 3 deletions vpnproxy_tui.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
__author__ = "duc_tin"
__copyright__ = "Copyright 2015+, duc_tin"
__license__ = "GPLv2"
__version__ = "1.1"
__version__ = "1.20"
__maintainer__ = "duc_tin"
__email__ = "[email protected]"

Expand Down Expand Up @@ -59,11 +59,10 @@ def __init__(self, data):
self.proto = 'tcp' if '\r\nproto tcp\r\n' in self.config_data else 'udp'
port = re.findall('remote .+ \d+', self.config_data)
if not port:
self.port = 0
self.port = '0'
else:
self.port = port[0].split()[-1]


def write_file(self, use_proxy='no', proxy=None, port=None):
txt_data = self.config_data
if use_proxy == 'yes':
Expand Down

0 comments on commit e3e62d3

Please sign in to comment.