Giter VIP home page Giter VIP logo

go-chat's Issues

部署在服务器上后发消息的两个小问题

作者您好
我把前后端部署在一个服务器上,然后用同一台windows的不同浏览器登录两个账号互相发送消息,遇到了两个问题:
1、发送文件功能好像没有作用,我在发送了一个文件之后,这个文件无法打开,右键也无法保存在本地
image

2、必须是配置好SSL证书,用https访问,才能使用摄像头等功能吗?

先感谢作者的解答,我是个新手,有不少困扰的地方,想借此机会好好学习您的项目。

升级为websocket协议时等待了4分钟,从而ws链接失败

conn, err := upGrader.Upgrade(c.Writer, c.Request, nil) //1
if err != nil {
retrun
}
messageType, message, err := conn.ReadMessage() //2
if err != nil {
lg.Debug("conn.ReadMessage err:", err, ", messageType:", messageType)
return
}
错误:time="2023-07-06T19:10:17+08:00" level=debug msg="conn.ReadMessage err:read tcp 127.0.0.1:8080->127.0.0.1:54657: wsarecv: An established connection was aborted by the software in your host machine., messageType:-1"
从1到2等待了4min, 请问是什么原因?

给你点个赞

最近想自己搭一套前台界面,这个前后端项目用到的技术正好是自己打算用的。感谢~

呜呜一些问题

单聊经常出现的两个问题

①.两人聊天互发消息, 只有一人能收到另一个人的消息

②.在聊天界面时,有时候自己的名字会显示为对方的名字

image

image

如图,一开始rr给ff发送"我是rr",然后ff给rr发送"我是ff",然而ff并没有收到rr的消息我是"rr".

而且,rr的名字在聊天界面却显示为对方的ff

image

我似乎没有修改过代码,是不是哪里出了问题呢?我看了websocket消息在后台是正常发出的,会不会是前端的问题.作者如果能修复将不胜感激(对我来说是个非常好的项目呜呜)

请问下视频聊天经常看不到画面问题

在2台不同的电脑,视频聊天,可以拉起聊天,但是都是只能看到自己的画面,偶尔能看到对方的画面,可以通过调整什么配置之类的来解决这个问题吗?

并发安全

gorilla/websocket的文档写道:
Connections support one concurrent reader and one concurrent writer.

Applications are responsible for ensuring that no more than one goroutine calls the write methods (NextWriter, SetWriteDeadline, WriteMessage, WriteJSON, EnableWriteCompression, SetCompressionLevel) concurrently and that no more than one goroutine calls the read methods (NextReader, SetReadDeadline, ReadMessage, ReadJSON, SetPongHandler, SetPingHandler) concurrently.

The Close and WriteControl methods can be called concurrently with all other methods.

所以在读写websocket消息的两个goroutine中并发调用WriteMessage方法是不可以的

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.