add proxy
This commit is contained in:
parent
b9efbfcfb9
commit
087d40be0b
2
.gitignore
vendored
2
.gitignore
vendored
@ -6,4 +6,6 @@
|
||||
\.\#*
|
||||
~*.*
|
||||
\#*.*
|
||||
__pycache__
|
||||
*.pyc
|
||||
gitlab/repository
|
||||
|
10
scripts/proxy/cliside.py
Normal file
10
scripts/proxy/cliside.py
Normal file
@ -0,0 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
class ClientSide:
|
||||
|
||||
def __init__(self, local_ip, remote_ip):
|
||||
self._local_ip = local_ip
|
||||
self._remote_ip = remote_ip
|
||||
|
||||
def run(self):
|
||||
pass
|
24
scripts/proxy/proxy.py
Executable file
24
scripts/proxy/proxy.py
Executable file
@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
import time
|
||||
|
||||
from optparse import OptionParser
|
||||
|
||||
import srvside
|
||||
import cliside
|
||||
|
||||
parser = OptionParser(usage="%prog [options]")
|
||||
parser.add_option("-l",
|
||||
"--listen",
|
||||
dest = "port",
|
||||
help = "listen local remote port")
|
||||
parser.add_option("-f",
|
||||
"--forward",
|
||||
dest = "forward",
|
||||
help = "forward local remote ip")
|
||||
(options, args) = parser.parse_args()
|
||||
|
||||
if options.forward:
|
||||
srvside.ServerSide(options.forward, args[0]).run()
|
||||
else:
|
||||
cliside.ClientSide(options.port, args[0]).run()
|
10
scripts/proxy/srvside.py
Normal file
10
scripts/proxy/srvside.py
Normal file
@ -0,0 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
class ServerSide:
|
||||
|
||||
def __init__(self, local_port, remote_port):
|
||||
self._local_port = local_port
|
||||
self._remote_port = remote_port
|
||||
|
||||
def run(self):
|
||||
pass
|
Loading…
x
Reference in New Issue
Block a user