Comments (4)
Hi, I'm asking for your code.
I saw that you use koa2 is a great framework, but it is only used in the authentication/login phase.
To improve the performance and make the code more homogeneous, I would use only socket.io
So it's better to remove koa2 and use socket.io also for registration and login.
What do you think about it?
Hi, @ciaoamigo . I think using socket.io in authentication/login/register worries me about the performance because socket.io will take long connection. And in these scenarios, the long connection is not necessary but increasing the server pressure. So I decided to use HTTP instead of socket.io in these scenarios and start the long connection by socket.io after the user logs in. It is just my personal opinion, welcome to discuss. 😃
from ghchat.
Sure. But just connect via socket only when:
- When I log in
- When I register.
This makes the application homogeneous with the following advantages:
- all connections to the backend come only via socket;
- easier to create a sdk-client to use with both react.js and react-native
- simpler maintenance as less technology is used;
etc.
from ghchat.
Sure. But just connect via socket only when:
- When I log in
- When I register.
This makes the application homogeneous with the following advantages:
- all connections to the backend come only via socket;
- easier to create a sdk-client to use with both react.js and react-native
- simpler maintenance as less technology is used;
etc.
Good idea.👍
I got it. Init to connect socket and emit request when the user clicks the button to log in or register. I will refactor it in the future. Thank you very much.
If you are interested in it, welcome to develop this project together. 😄
from ghchat.
Hi, @ciaoamigo. I am going to refactor the part where we talk about. But I find that If I use socket.io instead of the HTTP request When the user clicks the register button but fails, at this time the server has to keep connect to client(long connect, needless performance loss) because the user maybe tries against after a period of time. What do you think about?
from ghchat.
Related Issues (15)
- photo url
- Something wrong caused by missing 'secret.js' HOT 3
- 问题反馈 HOT 2
- 引进eslint
- 关于ESLint检测未修复的问题与改进建议 HOT 2
- UI改版
- safari 浏览器登录后刷新会先连接再断开 HOT 7
- api设计问题 HOT 3
- 产品设计及定位 HOT 2
- Server load issue HOT 8
- 客户端中InitApp/index.js为什么会被默认初始化并执行 HOT 4
- demo? HOT 2
- 线上SSL证书过期了
- multilingual solution with I18 HOT 5
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 ghchat.