Add host parameter to boxesserver
This commit is contained in:
parent
589c3a18c4
commit
c8d93bfe14
|
@ -540,15 +540,20 @@ class BServer:
|
|||
|
||||
|
||||
if __name__=="__main__":
|
||||
if len(sys.argv) > 1:
|
||||
port = int(sys.argv[1])
|
||||
else:
|
||||
host = ''
|
||||
port = 8000
|
||||
if len(sys.argv) > 1:
|
||||
tmp = sys.argv[1].split(':')
|
||||
if len(tmp) == 2:
|
||||
host = tmp[0]
|
||||
port = int(tmp[1])
|
||||
else:
|
||||
port = int(tmp[0])
|
||||
fc = FileChecker()
|
||||
fc.start()
|
||||
boxserver = BServer()
|
||||
httpd = make_server('', port, boxserver.serve)
|
||||
print("BoxesServer serving on port %s..." %port)
|
||||
httpd = make_server(host, port, boxserver.serve)
|
||||
print("BoxesServer serving on host:port %s:%s..." % (host, port) )
|
||||
httpd.serve_forever()
|
||||
else:
|
||||
application = BServer().serve
|
||||
|
|
Loading…
Reference in New Issue