2881099 / FreeIM

.NETCore websocket 实现简易、高性能、集群即时通讯组件,支持点对点通讯、群聊通讯、上线下线事件消息等众多实用性功能.
MIT License
1.42k stars 418 forks source link

Winform的ClientWebSocket始终联不上 #29

Open loryrichie opened 3 years ago

loryrichie commented 3 years ago

ClientWebSocket client = new ClientWebSocket(); client.ConnectAsync(new Uri("ws://127.0.0.1:6001/ws?token=f5e2fdf65e5c4a1f9fc677c8a3e6b99ccd35347169084455a33d01af3fc350ba728e58799bc6434e8c3b9e82b206eddaa4a88d85150b4315856a5e6ecfd3543a"), CancellationToken.None).Wait() ;

联不上。不知道什么原因,求大佬 指点

2881099 commented 3 years ago

token 是从服务端接口获取的吗

loryrichie commented 3 years ago

是的

2881099 commented 3 years ago

127.0.0.1 6001 是什么服务

loryrichie commented 3 years ago

string urls = "http://localhost:47205/ws/pre-connect"; string result=HttpHelper.PostRequest(urls); ServerModel server= JsonConvert.DeserializeObject(result); websockedid = server.websocketId; ClientWebSocket client= new ClientWebSocket(); client.ConnectAsync(new Uri(server.server), CancellationToken.None).Wait(20) ;

loryrichie commented 3 years ago

127.0.0.1 6001 是什么服务

6001是通过weiapi获取到的

2881099 commented 3 years ago

imserver 启动是用 127.0.0.1:6001 吗

loryrichie commented 3 years ago

imserver 启动是用 127.0.0.1:6001 吗

启动的时候显示:127.0.0.1:5000

loryrichie commented 3 years ago

image

loryrichie commented 3 years ago

我也很不解,在imserver里配置的 6001 ,怎么启动的时候就变5000了

2881099 commented 3 years ago

imserver 启动参数

—urls=http://127.0.0.1:6001

webapi, imserver 配置值 server 值都是 127.0.0.1:6001

webapi, imserver 的 redis 配置一样

imserver 的配置 servers 也配置成 127.0.0.1:6001

loryrichie commented 3 years ago

imserver 启动参数

—urls=http://127.0.0.1:6001

webapi, imserver 配置值 server 值都是 127.0.0.1:6001

webapi, imserver 的 redis 配置一样

imserver 的配置 servers 也配置成 127.0.0.1:6001

好的,谢谢大佬 ,我再重新弄下。

loryrichie commented 3 years ago

image 这张 图,显示的是5000,其实是6001,本机telnet 5000是不成功的,6001是成功 的,为什么要这么显示呢,有点奇怪

loryrichie commented 3 years ago

查了资料如果不指定端口,这里默认显示5000,原来是MS搞的

loryrichie commented 3 years ago

winform 还是连不上

2881099 commented 3 years ago

是什么提示?

loryrichie commented 3 years ago

是什么提示?

connecting 然后超时

2881099 commented 3 years ago

那就是连不上 imserver

1031918012 commented 2 weeks ago

image 我昨天遇到了类似的问题,再配置文件中配一下Urls启动站点之后就好了