def main(argv):  # pragma: no cover
    ip = "127.0.0.1"
    port = 5684
    file_xml = "reverse_proxy_mapping.xml"
    try:
        opts, args = getopt.getopt(argv, "hi:p:f:", ["ip=", "port=", "file="])
    except getopt.GetoptError:
        usage()
        sys.exit(2)
    for opt, arg in opts:
        if opt == '-h':
            usage()
            sys.exit()
        elif opt in ("-i", "--ip"):
            ip = arg
        elif opt in ("-p", "--port"):
            port = int(arg)
        elif opt in ("-f", "--file"):
            file_xml = arg

    server = CoAPReverseProxy(ip, port, file_xml)
    try:
        server.listen(10)
    except KeyboardInterrupt:
        print "Server Shutdown"
        server.close()
        print "Exiting..."
dataset/ETHPy150Open Tanganelli/CoAPthon/coapreverseproxy.py/main/original