Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: 正向WS 6700端口使用了IPV6 #1438

Closed
4 tasks done
Bearlele opened this issue Mar 23, 2022 · 5 comments
Closed
4 tasks done

[Bug]: 正向WS 6700端口使用了IPV6 #1438

Bearlele opened this issue Mar 23, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@Bearlele
Copy link

请确保您已阅读以上注意事项,并勾选下方的确认框。

  • 我已经仔细阅读上述教程和 "提问前需知"
  • 我已经使用 dev分支版本 测试过,问题依旧存在。
  • 我已经在 Issue Tracker 中找过我要提出的问题,没有找到相同问题的ISSUE。
  • 我已知晓并同意,此处仅用于汇报程序中存在的问题。若这个 Issue 是关于其他非程序本身问题,则我的 Issue 可能会被无条件自动关闭或/并锁定。(这些问题应当在 Discussion 板块提出。)

go-cqhttp 版本

v1.0.0-rc1

运行环境

Linux

运行架构

AMD64

连接方式

WebSocket (正向)

使用协议

0 | iPad

重现步骤

系统已禁用所有ipv6服务,但正向ws还是使用了ipv6类型,导致跨服务器使用ipv4无法连接,反向ws正常使用ipv4。

期望的结果是什么?

正向ws 6700端口使用ipv4

实际的结果是什么?

正向ws 6700端口使用了ipv6,没有使用ipv4

简单的复现代码/链接(可选)

root@GZ-Debian:~# lsof -i:8080
go-cqhttp 1996424 root   14u  IPv4 32631659      0t0  TCP GZ-Debian:52000->120.232.31.106:http-alt (ESTABLISHED)
go-cqhttp 1996424 root   15u  IPv4 32630299      0t0  TCP localhost:57338->localhost:http-alt (ESTABLISHED)

root@GZ-Debian:~# lsof -i:6700
COMMAND       PID USER   FD   TYPE   DEVICE SIZE/OFF NODE NAME
go-cqhttp 1996424 root   17u  IPv6 32631678      0t0  TCP *:6700 (LISTEN)

日志记录(可选)

No response

补充说明(可选)

No response

@Bearlele Bearlele added the bug? The issue author think this is a bug label Mar 23, 2022
@wdvxdr1123
Copy link
Collaborator

根据go标准库文档 https://pkg.go.dev/net#Listen
监听 0.0.0.0:6700 有可能是ipv4有可能是ipv6, 目前临时解决方法为改成监听 :6700(同时监听ipv4和ipv6)

目前可以考虑更改配置文件为network和address两项, network 默认为 tcp,如果需要只监听 ipv4 即改为 tcp4, 同时也一并支持了 #1415

@wdvxdr1123 wdvxdr1123 added enhancement New feature or request and removed bug? The issue author think this is a bug labels Mar 23, 2022
@Bearlele
Copy link
Author

明白了,谢谢

@Bearlele
Copy link
Author

root@GZ-Debian:~# lsof -i:6700
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
go-cqhttp 2001617 root 15u IPv6 32775632 0t0 TCP *:6700 (LISTEN)

改成监听 :6700 后还是只有IPV6

@wdvxdr1123
Copy link
Collaborator

请尝试使用 https://github.com/Mrs4s/go-cqhttp/actions/runs/2028112368
将配置文件改成 address: tcp4://0.0.0.0:6700

@Bearlele
Copy link
Author

不好意思现在才看到,成功解决啦!谢谢!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants