MCPcopy Index your code
hub / github.com/sshuttle/sshuttle / get_auto_method

Function get_auto_method

sshuttle/methods/__init__.py:114–126  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

112
113
114def get_auto_method():
115 debug3("Selecting a method automatically...")
116 # Try these methods, in order:
117 methods_to_try = ["nat", "nft", "pf", "ipfw"] if sys.platform != "win32" else ["windivert"]
118 for m in methods_to_try:
119 method = get_method(m)
120 if method.is_supported():
121 debug3("Method '%s' was automatically selected." % m)
122 return method
123
124 raise Fatal("Unable to automatically find a supported method. Check that "
125 "the appropriate programs are in your PATH. We tried "
126 "methods: %s" % str(methods_to_try))

Callers 1

mainFunction · 0.90

Calls 4

debug3Function · 0.90
FatalClass · 0.90
get_methodFunction · 0.85
is_supportedMethod · 0.45

Tested by

no test coverage detected