bjoern HTTP/1.1 WSGI 服务器 项目简介
bjoern 是个快速、超轻量级的 HTTP/1.1 WSGI 服务器软件,为 CPython 编写。使用 C 语言开发,基于 Libev 事件库和 http-parser 开发,这是一个单线程的服务,占用内存非常低。 示例代码: # Bind to TCP host/port pair:
bjoern.run(wsgi_application, host, port)
# TCP host/port pair, enabling SO_REUSEPORT if available.
bjoern.run(wsgi_application, host, port, reuseport=True)
# Bind to Unix socket:
bjoern.run(wsgi_application, 'unix:/path/to/socket')
# Bind to abstract Unix socket: (Linux only)
bjoern.run(wsgi_application, 'unix:@socket_name')
bjoern.listen(wsgi_application, host, port)
bjoern.run()
bjoern.run(wsgi_application, host, port)
# TCP host/port pair, enabling SO_REUSEPORT if available.
bjoern.run(wsgi_application, host, port, reuseport=True)
# Bind to Unix socket:
bjoern.run(wsgi_application, 'unix:/path/to/socket')
# Bind to abstract Unix socket: (Linux only)
bjoern.run(wsgi_application, 'unix:@socket_name')
bjoern.listen(wsgi_application, host, port)
bjoern.run()