Coder Social home page Coder Social logo

bondageclubchat's Introduction

2023.5.27

本项目针对一款在线聊天室,尝试使用了Python实现了一系列基础功能(暂时只实现了登录,创建房间与接收信息),其余的功能原理类似,纯粹的体力活了。

在线聊天室的基本代码均有JS实现,属于开源项目,与服务器之间的通讯使用的是websocket,全程无加密。再正常访问网站时,会先产生许多GET请求,会将全部的程序代码,资源全部加载到我们的前端浏览器,从而保证项目的运行。与此同时打开一个websocket端口,将前台的交互数据发送到服务器端。中间没有任何防护,前台的所有数据,只要以对应的格式进行发送,服务器就就会解析与保存(包括个人信息,服装,金币等)。

在聊天室中,服务器采取的是一种转发模式,当一个用户提交一段聊天数据时,服务器会根据当前该用户所在的房间进行转发,将message或状态转发给当前房间中的所有用户,交由用户浏览器进行解析,产生相应的动作。这样可极大程度减少服务器的负载。这就是为什么长时间挂载聊天室会导致浏览器内存使用越来越大,因为每当一个用户进入房间后,客户端就会接收到该用户所有资源,包括但不限于bio,服装资源等。

当前大多数项目都通过JS+PHP对聊天室进行功能扩充或者代码重构,本项目则尝试使用Python完成此类功能。

当前已完成功能:

Chatroom_main作为主函数进行一些调用,为后实现多线程做准备(如果有必要的话)

Chatroom_connect作为连接服务器函数,实现对服务器信息的响应

Chatroom_fun作为各项功能实现的基本函数

bondageclubchat's People

Contributors

cwh031600 avatar

Watchers

 avatar

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.