Websocket connection failed #394
Unanswered
saurabhgharatpara
asked this question in
Q&A
Replies: 1 comment 4 replies
-
Did you declare a WebSocketGateway for that handler? Also, do you have any middlewares implemented? |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've added websocket handler
@websocket(path="/ws")
async def websocket_endpoint(socket: WebSocket) -> None:
await socket.accept()
await socket.send_text("Hello!")
await socket.close()
and on the frontend i've called const socket = new WebSocket('ws://127.0.0.1:8000/ws')
but im getting connection failed 403 refused
is it missing anything ?
Beta Was this translation helpful? Give feedback.
All reactions