mirror of
https://github.com/lnbits/lnbits.git
synced 2025-09-25 19:36:15 +02:00
fix: copilot websocket connections
This commit is contained in:
@@ -239,8 +239,7 @@
|
||||
':' +
|
||||
location.port +
|
||||
'/copilot/ws/' +
|
||||
self.copilot.id +
|
||||
'/'
|
||||
self.copilot.id
|
||||
} else {
|
||||
localUrl =
|
||||
'ws://' +
|
||||
@@ -248,8 +247,7 @@
|
||||
':' +
|
||||
location.port +
|
||||
'/copilot/ws/' +
|
||||
self.copilot.id +
|
||||
'/'
|
||||
self.copilot.id
|
||||
}
|
||||
this.connection = new WebSocket(localUrl)
|
||||
this.connection.onmessage = function (e) {
|
||||
|
@@ -1,4 +1,5 @@
|
||||
from http import HTTPStatus
|
||||
from typing import List
|
||||
import httpx
|
||||
from collections import defaultdict
|
||||
from lnbits.decorators import check_user_exists
|
||||
@@ -70,7 +71,7 @@ class ConnectionManager:
|
||||
manager = ConnectionManager()
|
||||
|
||||
|
||||
@copilot_ext.websocket("/ws/{socket_id}")
|
||||
@copilot_ext.websocket("/copilot/ws/{socket_id}", name="copilot.websocket_by_id")
|
||||
async def websocket_endpoint(websocket: WebSocket, socket_id: str):
|
||||
await manager.connect(websocket)
|
||||
try:
|
||||
|
Reference in New Issue
Block a user