Comments (13)
from freeim.
from freeim.
wss 他 imcore im 没有绑定关系,wss 参考 https aspnetcore 配置的教程就好了。
from freeim.
谢谢回复
现在的场景如下:
1.终端是小程序
2.web api 是.net framework 4.5
3.按照昨天您提示的我发布了ImServer.exe
4.IP连接没有问题,ImServer.exe 这怎么绑定域名啊,感谢
from freeim.
ImServer.exe 这怎么绑定域名
public class Program
{
public static void Main(string[] args)
{
var host = new WebHostBuilder()
.UseKestrel(option=> {
option.UseHttps("server.pfx", "linezero");
})
.UseUrls("https://www.baidu.com:443")
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration()
.UseStartup<Startup>()
.Build();
host.Run();
}
}
from freeim.
websocket 不限制端口号,小程序可以用 wss://www.baidu.com:6001 连接
from freeim.
.UseKestrel(option=> {
option.UseHttps("server.pfx", "linezero");
})
.UseUrls("https://www.baidu.com:443")
这两个配置是关键,其他资料可以到百度搜索:aspnetcore https 配置
from freeim.
可以理解为把ImServer下的Program文件增加
.UseKestrel(option=> {
option.UseHttps("server.pfx", "linezero");
})
.UseUrls("https://www.baidu.com:443")'
如上代码,ImServer可以部署在iis上,由iIS承载吗?
from freeim.
不用挂载,独立运行
from freeim.
搞不定,崩溃:
Startup.cs
app.UseImServer(new ImServerOptions { Redis = new CSRedis.CSRedisClient("127.0.0.1:6379,poolsize=5"), Servers = new[] { "39.243.73.68:8080" }, Server = "39.243.73.68:8080" });
Program.cs
WebHost.CreateDefaultBuilder(args) .UseKestrel(options => { options.Listen(IPAddress.Loopback, 8080, listenOptions => { listenOptions.UseHttps("message.pfx", "9874321"); }); }) .UseUrls("https://www.baidu.com:8080") .UseStartup<Startup>();
预连接代码,ws调整为wss
public string PrevConnectServer(Guid clientId, string clientMetaData) { var server = SelectServer(clientId); var token = $"{Guid.NewGuid()}{Guid.NewGuid()}{Guid.NewGuid()}{Guid.NewGuid()}".Replace("-", ""); _redis.Set($"{_redisPrefix}Token{token}", JsonConvert.SerializeObject((clientId, clientMetaData)), 10); return $"wss://{server}{_pathMatch}?token={token}"; }
结果报错如下:
以一种权限不允许的方式做了一个访问套接字的尝试
网上说是端口占用的问题,更改后依然报此错误。
期待帮助,谢谢!
from freeim.
实在弄不好的话,就用 http 转发吧,把其他 https 的服务器转发给这里。就不用在这里配置 ssl 了
from freeim.
方便留个交流方式或者建个群不,付费指导也行啊,发了二天时间了搞不定,今天才发现API获取ws url后根本连接不上。
QQ:18477899
加你了,等通过
from freeim.
结贴,在作者的远程指导下终于连线成功,抽时间整理一下发出来,避免其它使用者再走弯路,感谢!
from freeim.
Related Issues (20)
- api 端了做了load balance 出现消息重复发送 HOT 1
- 加载index.html的时候报错,好像是连不上websocket
- 现在server 可以负载了,可以加一个单个server 的高可用
- 我在用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
- 我真有点搞不懂 HOT 14
- 查了资料如果不指定端口,这里默认显示5000,原来是MS搞的
- 如何清理online表的无效数据? HOT 3
- 大神,网络斗d主不见了 HOT 1
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.