mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-29 05:09:46 +01:00
部分修改
This commit is contained in:
parent
cc6ab70341
commit
99e403f89e
3 changed files with 15 additions and 5 deletions
|
|
@ -1,5 +1,9 @@
|
|||
# Tomcat
|
||||
server:
|
||||
# ssl:
|
||||
# key-store: classpath:ssl.pfx
|
||||
# key-store-password: zy123456
|
||||
# key-store-type: PKCS12
|
||||
tomcat:
|
||||
uri-encoding: UTF-8
|
||||
threads:
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ server:
|
|||
# 当你使用docker部署或使用公网部署(使用ssl、域名)时,不一定准确
|
||||
# 所以如果你使用docker部署时,将websocket设置成局域网地址
|
||||
# 如果你使用公网部署时,将vwebsocket设置成公网地址
|
||||
websocket: ws://你的ip或者域名:端口号/xiaozhi/v1/
|
||||
websocket: ws://192.168.31.182:8000/xiaozhi/v1/
|
||||
# 视觉分析接口地址
|
||||
# 向设备发送的视觉分析的接口地址
|
||||
# 如果按下面默认的写法,系统会自动生成视觉识别地址,并输出在启动日志里,这个地址你可以直接用浏览器访问确认一下
|
||||
|
|
|
|||
|
|
@ -47,10 +47,16 @@ class WebSocketServer:
|
|||
keyfile=ssl_config["keyfile"]
|
||||
)
|
||||
print(f"run with SSL")
|
||||
async with websockets.serve(
|
||||
self._handle_connection, host, port, process_request=self._http_response, ssl=ssl_context
|
||||
):
|
||||
await asyncio.Future()
|
||||
async with websockets.serve(
|
||||
self._handle_connection, host, port, process_request=self._http_response, ssl=ssl_context
|
||||
):
|
||||
await asyncio.Future()
|
||||
else:
|
||||
print(f"run without SSL")
|
||||
async with websockets.serve(
|
||||
self._handle_connection, host, port, process_request=self._http_response
|
||||
):
|
||||
await asyncio.Future()
|
||||
|
||||
async def _handle_connection(self, websocket):
|
||||
"""处理新连接,每次创建独立的ConnectionHandler"""
|
||||
|
|
|
|||
Loading…
Reference in a new issue