Browse Source

fix issue where tcp default string wasn't supported..

main
John-Mark Gurney 4 years ago
parent
commit
5ee76cbbef
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      ntunnel/__init__.py

+ 4
- 4
ntunnel/__init__.py View File

@@ -227,11 +227,9 @@ def parsesockstr(sockstr):
if '=' not in rem:
if proto == 'unix' and rem[0] != '/':
raise ValueError('bare path MUST start w/ a slash (/).')

if proto == 'unix':
elif proto == 'unix':
args = { 'path': rem }

if proto == 'udp':
elif proto in ('tcp', 'udp'):
h, p = rem.split(':')
args = { 'host': h, 'port': p }
else:
@@ -557,6 +555,8 @@ class Tests_misc(unittest.TestCase):
# function
'unix:/apath': ('unix', { 'path': '/apath' }),
'unix:path=apath': ('unix', { 'path': 'apath' }),
'tcp:ahost:1234': ('tcp', { 'host': 'ahost',
'port': 1234 }),
'tcp:host=apath': ('tcp', { 'host': 'apath' }),
'tcp:host=apath,port=5': ('tcp', { 'host': 'apath',
'port': 5 }),


Loading…
Cancel
Save