#!/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:
    cliside.ClientSide(options.forward, args[0]).run()
else:
    srvside.ServerSide(options.port, args[0]).run()
