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