Comments (14)
你需要注意,Server/Servers 和 dotnet 参数 --urls 要对应
from freeim.
您帮我看下,我这些配置参数是否正确
我配置发布在服务器上的信息
服务器IP地址:91.208.206.38
IMServer的appsettings.json参数如下:
{
"Logging": {
"LogLevel": {
"Default": "Warning"
}
},
"AllowedHosts": "*",
"ImServerOption": {
"RedisClient": "127.0.0.1:6379,poolsize=10",
"Servers": "91.208.206.38:6001",
"Server": "91.208.206.38:6001"
}
}
IMServer的launchSettings.json参数如下:
{
"profiles": {
"imServer": {
"commandName": "Project",
"commandLineArgs": "--urls=http://91.208.206.38:6001"
}
}
}
以上参数配置我发布到服务器上运行打开显示如图
WebApi那么不部署服务器应该也是可以的,我就在本地调试运行
WebApi我在本地代码调试来连接我的91.208.206.38的IMServer服务
WebApi配置初始化参数
ImHelper.Initialization(new ImClientOptions
{
Redis = new FreeRedis.RedisClient("91.208.206.38:6379,poolsize=10"),
Servers = new[] { "91.208.206.38:6001" }
});
运行结果如图
Redis配置是正确的,为什么呢,如果Redis连接不上,那么WebApi是会报错的。没报错,说明Redis是正确的
麻烦帮我看下,我哪里配置错了?谢谢。
from freeim.
即使我把WebApi部署到91.208.206.38:80或者91.208.206.38:6001
都是一样的错误
testindex.html:66 WebSocket connection to 'ws://91.208.206.38:6001/ws?token=b925182cd3bb4a77a6a1f432edb558242d775c950a864ea1904c99103f1222325fe3fab090984e1bbd19cd00226971ec87d7a287a5c2437985ae5a60ae1fd217' failed:
from freeim.
怎么配都不正确啊,这组合我都配烂了
from freeim.
我发布了,运行,为什么都是http://localhost:5000
IMServer信息都是:
info: Microsoft.Hosting.Lifetime[14]
Now listening on: http://localhost:5000
info: Microsoft.Hosting.Lifetime[14]
Now listening on: https://localhost:5001
info: Microsoft.Hosting.Lifetime[0]
Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
Hosting environment: Production
info: Microsoft.Hosting.Lifetime[0]
Content root path: D:\FreeMi\IMServer
from freeim.
不管我怎么改,发布运行都是下面的提示
info: Microsoft.Hosting.Lifetime[14]
Now listening on: http://localhost:5000/
from freeim.
原来是我的服务器没开5000端口,防火墙我是没开,服务商没开5000
from freeim.
耐心一些,总共只有几个配置
IMServer的launchSettings.json参数如下:
{
"profiles": {
"imServer": {
"commandName": "Project",
"commandLineArgs": "--urls=http://91.208.206.38:6001/"
}
但是你反馈的日志是 localhost:5001 说明配置没有生效
from freeim.
是不支持windows server 2012版本的服务器吗?
IMServer的launchSettings.json参数如下:
{
"profiles": {
"imServer": {
"commandName": "Project",
"commandLineArgs": "--urls=http://91.208.206.38:6001/"
}
这个我肯定是配置了的
from freeim.
@sfindme 兄弟你可以看下你的IIS有没有开websockt协议支持,我今天也遇到这个问题了,结果就是IIS 没开ws协议支持,你看下这https://learn.microsoft.com/zh-cn/iis/get-started/whats-new-in-iis-8/iis-80-websocket-protocol-support
from freeim.
我安装了的,安装完就可以了吧?还需要手动配置吗?
from freeim.
老哥你弄好了?
from freeim.
终于搞定了,三个关键点
1.服务器要安装WebSocket协议,开放端口,服务商的,服务器的都要开。
2.生成的时候有可能生成了三个配置文件,导致不一样,部署到服务器的时候,使用的是appsettings.Production.json,所需要改这个文件里面的IP和端口,才能一致,三个都改一下,都试试。
appsettings.Production.json
appsettings.json
appsettings.Development.json
3.launchSettings.json设置不生效的时候,需要手动设置端口在
IMServer的Program.cs文件中。
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup()
.UseUrls("http://*:6001"); //直接指定端口;
});
from freeim.
后续同志参考这篇文章
https://blog.csdn.net/sD7O95O/article/details/136892307
from freeim.
Related Issues (20)
- 我在用Imcore做服务器端的时候,app端这边,如果是刚开始运行,能正常连接,但如果在app里面切换账号,然后就要重新换token连接,并且能够连上去,但过一会儿就关闭了。 HOT 2
- 希望能支持视频聊天
- imServer和web业务能否集成在一起呢 HOT 2
- 前端设置心跳检测,30秒后重连token失效 HOT 2
- 我给redis设置密码了,c#代码里面要怎么写? HOT 5
- 服务端出现多条上线、下线通知 HOT 6
- 部署到 centos ,出现错误:【127.0.0.1:6379/0】The operation is not allowed on non-connected sockets HOT 1
- 这个im支持发布在windows server 2016上吗? HOT 4
- 消息回执 HOT 2
- 在https方式下收不到消息 HOT 2
- 视频通话如何接入? HOT 2
- 作为游戏大厅服务器可行吗? HOT 1
- 关于WSS的配置问题 HOT 9
- 查了资料如果不指定端口,这里默认显示5000,原来是MS搞的
- 如何清理online表的无效数据? HOT 3
- 大神,网络斗d主不见了 HOT 1
- 您好,这个框架只适用于uniapp编写的app吧?原生的app不适用这个FreeIM框架吧,哪怕是服务端用ImServer 服务端,客户端用app原生的websocket client 库 HOT 1
- 关于旧websocket连接释放问题 HOT 1
- 关于wss可以连接不能收发消息的问题 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from freeim.