Skip to content

[Feature] 为什么网站跟emqx进行webscoket连接,每隔1分钟就会掉线重连 #9384

Closed

Description

@AlexQiulin

1Panel Version

2.02

Please describe your needs or suggestions for improvements

我在1panel中建立的网站跟在1panel中建立的emqx5.10进行webscoket连接时,每隔1分钟都会掉线一次,以下方式我都尝试过了,都没有得到解决。
1:修改nginx配置 proxy_read_timeout 3600s; proxy_send_timeout 3600s;
2:把emqx的网络切换为host (绕开了NAT)
3:尝试使用了ssl
4:挂载了本地的时区/etc/localtime ( OpenResty emqx 本地电脑 时区都保持着一致)

很奇怪的是,我在宝塔上进行这样同样的设置,宝塔搭建的网站和宝塔docker中的emqx进行连接不会出现每分钟掉线的情况,并且我用1panel上的网站去连接宝塔上部署的emqx也不会出现每分钟掉线的情况。

请各位大神帮忙指点一下

Please describe the solution you suggest

No response

Additional Information

No response

Activity

  1. AlexQiulin commented on Jul 2, 2025

    @AlexQiulin
    Author

    以下是我网站前端的代码

    const client = mqtt.connect('ws://ip:8083/mqtt', {
    clientId: clientId,
    username: username,
    password: password,
    keepalive: 60,
    reconnectPeriod: 1000,
    clean: true
    });

    当我把keepalive设置为30 或者更低 时也会出现掉线的问题

  2. wanghe-fit2cloud commented on Jul 2, 2025

    @wanghe-fit2cloud
    Member

    将该 Issue 转为 Discussion,方便大家共同探讨和交流。

  3. locked and limited conversation to collaborators on Jul 2, 2025
  4. converted this issue into a discussion #9385 on Jul 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions