Skip to content
This repository has been archived by the owner on Feb 28, 2019. It is now read-only.
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
Cannot retrieve contributors at this time
#!/usr/bin/env python3
# coding=utf-8
import sys
import os
sys.path.insert(0, os.path.dirname(__file__))
if os.path.dirname(__file__) != '':
from zmirror.zmirror import app as application
__author__ = 'Aploium <>'
def main():
from zmirror.zmirror import my_host_port, built_in_server_host, \
built_in_server_debug, built_in_server_extra_params, warnprint, \
warnprint("You may directly running zmirror, which is NOT recommend for PRODUCTION environment.\n"
"Please deploy it using Apache,You can find a deploy tutorial here:\n"
if my_host_port is None:
my_host_port = 80
# 如果配置文件中开启了多进程, 那么就关掉多线程, 否则默认启用多线程
threaded="processes" not in built_in_server_extra_params,
# 如果你想直接用本程序给外网访问, 请在 末尾加两行配置
# !!警告!! 无论如何都不要修改, 否则程序将无法通过 git pull 来升级
# built_in_server_host=''
# built_in_server_debug=False
# ps:字母在行首, 行首不要有空格
# !!警告!! 无论如何都不要修改本文件, 否则程序将无法通过 git pull 来升级
debug=built_in_server_debug, # 默认是开启debug模式的
# 默认只允许本机访问, 如果你希望让外网访问, 请根据上面的注释修改配置文件
**built_in_server_extra_params # extra params
except OSError as e:
if e.errno in (98, 10013): # Address already in use, 98 for linux, 10013 for win
errprint("Port {port} was occupied by other program, please close it.\n"
"You can see which process is using your port by the following command:\n"
" Linux: netstat -apn |grep \":{port}\"\n"
" Windows: netstat -ano |find \":{port}\"\n\n"
"Or change zmirror\'s port: change(add, if not exist) the `my_host_port` setting in ``\n"
"eg: my_host_port=81".format(port=my_host_port))
if __name__ == '__main__':