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