mirror of
https://github.com/sshuttle/sshuttle.git
synced 2025-07-06 17:50:35 +02:00
Really basic transproxying on localhost.
When regenerating outgoing connections, we set TTL=42 to prevent re-proxying of requests. That's a little hacky, but at least it avoids infinite loops.
This commit is contained in:
29
main.py
29
main.py
@ -1,2 +1,29 @@
|
||||
#!/usr/bin/env python
|
||||
import ssh, options
|
||||
import sys
|
||||
import options, client
|
||||
|
||||
optspec = """
|
||||
sshuttle [-l [ip:]port] [-r [username@]sshserver] <subnets...>
|
||||
--
|
||||
l,listen= transproxy to this ip address and port number [default=0]
|
||||
r,remote= ssh hostname (and optional username) of remote sshuttle server
|
||||
server [internal use only]
|
||||
iptables [internal use only]
|
||||
"""
|
||||
o = options.Options('sshuttle', optspec)
|
||||
(opt, flags, extra) = o.parse(sys.argv[1:])
|
||||
|
||||
if opt.server:
|
||||
o.fatal('server mode not implemented yet')
|
||||
sys.exit(1)
|
||||
elif opt.iptables:
|
||||
o.fatal('iptables mode not implemented yet')
|
||||
sys.exit(1)
|
||||
else:
|
||||
if len(extra) < 1:
|
||||
o.fatal('at least one argument expected')
|
||||
remotename = extra[0]
|
||||
if remotename == '' or remotename == '-':
|
||||
remotename = None
|
||||
subnets = extra[1:]
|
||||
sys.exit(client.main(remotename, subnets))
|
||||
|
Reference in New Issue
Block a user