Socket.IO not connecting in Chrome browser (HTTPS, custom port 6530)
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 20/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- javascript, laravel, react
- 领域
- backend, frontend, networking
调研方向
首先检查 React 连接代码和已配置的 CHAT_URL,然后将失败的 Chrome 请求与 HTTPS 部署中列出的 wss://example001:6530/socket.io 端点进行比较。完成的标准是 React 站点无需先打开 Laravel 站点即可在 Chrome 中连接,同时现有的本地 HTTP 行为仍能正常工作。
由索引模型根据 Issue 内容生成。
描述
Socket issue:
My Laravel backend is hosted on https://example001.com/, while my Reactapp is hosted on https://example002.com./ React uses the 4.8.1 version of the socket.io client, and Laravel uses the 4.7.5 version. What happens if I don't open website, https://example001.com/(my primary chat.js code), in Chrome so My https://example002.com/ website won't connect to the socket, breaks the socket connection, and displays a Websocket error.
What need I do to effectively run my https://example001.com/ without opening that website?..(SAFARI ,FIRE FOX RUNNING WELL)
My local (http) environment works properly, and the only problem is with the https environment.
My local (http) environment works properly, and the only problem is with the https environment.
Error :
Socket connection error---------: J: websocket error at Z.onError (https://example002.com/assets/engine.io-client-C44f3zIw.js:1:1577) at ws.onerror (https://example002.com/assets/engine.io-client-C44f3zIw.js:1:7721)
Server listing on: wss://example001:6530/socket.io/?user_id=1&user_token=eU1GUXBpbk...&user_type=admin&user_status=active&environment=production&EIO=4&transport=websocket
code:
export const handleSocketConnection = createAsyncThunk(
"socket/connectSocket",
async (data, thunkAPI) => {
const { user_id, user_type, user_token } = data;
var options = {
transports: ['websocket'],
query: {
user_id,
user_token,
user_type,
},
secure: true,
withCredentials: false,
};
try {
const socket = io(CHAT_URL, options);
socket.on("connect", () => {
console.log("Socket connected successfully");
thunkAPI.dispatch(setSocketConnected(true));
}
);
socket.on("connect_error", (err) => {
console.error("Socket connection error---------:", err);
});
socket.on("disconnect", () => {
console.log("Socket disconnected");
thunkAPI.dispatch(setSocketConnected(false));
});
return thunkAPI.dispatch(setSocket(socket));
} catch (error) {
thunkAPI.dispatch(setSocketConnected(false));
return rejectWithValue(error);
}
}
);
- 主要语言
- TypeScript
- 星标
- 63.2k
- 派生
- 10.2k
- 平均合并
- 6 天 4 小时
- 30 天内合并 PR
- 6
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
socketio/socket.io 的其他 Issue
-
[engine.io-client] The Node.js cookie jar lets Expires override Max-Age可能已有人在做 @Ayush701-code-zm 于 1 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 88/100
socketio/socket.io#5590 · 1 条评论 ·
维护者通常 2 天内回复
-
Raise Engine.IO minimum to 6.6.10 for published security fixes可能已有人在做 @harshit-exe-dev 于 29 天前认领。 未关闭
难度 1/5 1-3 小时 新手友好度 78/100
维护者通常 2 天内回复
-
Can't set response headers in Server.handleUpgrade可能已有人在做 @MsfPablo 于 90 天前认领。 未关闭question
难度 2/5 1-3 小时 新手友好度 72/100
socketio/socket.io#5497 · 2 条评论 ·
维护者通常 2 天内回复
-
WebTransport ignores query parameters in URL可能已有人在做 @cyphercodes 于 178 天前认领。 未关闭needs major release question
难度 2/5 1-3 小时 新手友好度 68/100
socketio/socket.io#5496 · 3 条评论 ·
维护者通常 2 天内回复
-
[engine.io-client] close() called in an upgrade listener does not close the socket可能已有人在做 @adityajai119 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 20/100
维护者通常 2 天内回复
查看 socketio/socket.io 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 67/100
outline/outline#14529 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 86/100
g1331/phantom-circuit#93 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
compiler
难度 2/5 1-3 小时 新手友好度 74/100
HerringtonDarkholme/hd-lang#1699 ·
维护者通常 1 天内回复