最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

python - Other users cannot connect to the server on the websocket - Stack Overflow

programmeradmin8浏览0评论

I have a server on AWS EC2 with port 8001 open with a websocket application. The application itself is written in Django Channels and uses a daphne server.

The problem is that I myself can connect to the websocket server, but other users do not have such an opportunity for some reason

The script I'm using to connect

const socket = new WebSocket("ws://54.145.126.99:8001/ws/chat/first_user=19628&second_user=19629", ["Bearer", token]);

socket.onopen = function () {
   console.log("✅ connected to WebSocket server");
};

local application use http://127.0.0.1:5173/, application that use frontend dev also use http://localhost:5173/ and runs on React.

I don't know what further info i need to provide so that you can understand problem, because i have no idea where that error could be...

发布评论

评论列表(0)

  1. 暂无评论