散景服务器白名单

时间:2016-06-19 14:11:05

标签: python server tornado bokeh

如何使用我的白名单地址文件启动散景服务器?

我目前正在使用

启动它
python -m bokeh server --host x.x.x.x:5006 --host x.x.x.x:5006 --host x.x.x.x:5006 --host x.x.x.x:5006 --host x.x.x.x:5006 --host x.x.x.x:5006 --show myapp

我希望它是

python -m bokeh server --host whitelist.txt --show myapp

1 个答案:

答案 0 :(得分:2)

我想这个功能仍未在bokeh命令行中实现。但是可以使用一些bash语言。假设您在文件“whitelist.txt”中的多行中都有地址列表和服务器名称,例如

some.servername.com
xxx.xxx.xxx.xxx
some.other.server.com
yyy.yyy.yyy.yyy
...

然后你可以用:

启动你的散景服务器
cmd="bokeh serve myapp.py --port XXXX --prefix someprefix";while read line;do cmd+=" --host $line:80"; done <whitelist.txt;eval $cmd

然后您就可以在浏览器中访问您的应用程序了:

http://some.other.server.com/someprefix/myapp.py