我正在运行一个正在监听 0.0.0.0:9000 的Bottle v0.12.15服务器 . 我正在运行它的机器的IP是 192.168.0.16 .

我设置的唯一路线是重定向连接到静态 index.html 页面的任何人 .

每当我访问一个没有从我的网络上的一个设备设置路由的随机网址时,即 192.168.0.16:9000/asdf ,我始终按预期获得 Error: 404 并可以返回索引页面 .

但是,当从2个设备访问时,如果我登陆_193332_设备 1 ,在设备 2 上访问诸如 192.168.0.16:9000/asdf (应该给出404)的URL只会导致Bottle服务器挂起并且它不会给出响应直到我刷新另一台设备上的页面 .

我尝试添加一个错误路由,在获得404时会提供HTML页面,但同样的问题仍然存在 .

我不确定是什么导致了这个问题,或者我能做些什么来修复它,所以任何帮助都会非常感激 .

我正在运行的整个runserv.py文件如下所示:

from bottle import *

#error handling


@error(404)
def error404(error):
    return static_file("404.html", 
    root="./errorFiles")

@route('/')
def slash():
    redirect("/index")

@route('')
def empty():
    redirect("/index")

@route('/index')
def index():
    return static_file("index.html", root="./webpageFiles")

run(host='0.0.0.0', port=9000, debug=True, reloader=True)