Python Bokeh服务器白名单

Python Bokeh服务器白名单,python,server,tornado,bokeh,Python,Server,Tornado,Bokeh,如何启动一个地址为我的白名单的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

如何启动一个地址为我的白名单的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

我猜这个特性还没有在
bokeh
命令行中实现。但是可以使用一些bash语言。假设您在文件“whitelist.txt”中有几行地址和服务器名称列表,例如

然后,您可以通过以下方式启动bokeh服务器:

cmd="bokeh serve myapp.py --port XXXX --prefix someprefix";while read line;do cmd+=" --host $line:80"; done <whitelist.txt;eval $cmd

正如这个答案正确指出的那样,Bokeh中没有内置任何东西可以从文件中读取此内容。我建议将此作为GH的一个功能请求,但事实上,我们正在尝试这样做,因此不再需要主机白名单。
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