Comments (2)
@saksham7778 I've implemented this over on my repository here
Please take note of changes made to index.html, js/login.js, server.js
Long story short, it uses the global object Brad created to do the following:
- User requests to login
- Check if username exists in global state object
- If exists, send user back to home page and never proceed with any further socket stuff (e.g. joining a room...)
- If user is unique, carry on with Brad's normal socket flow so you can chat etc.
Pretty simple really, just need to apply some lateral thinking and problem solving skills. Anyone can copy paste code, but to take your learning to the next level I suggest not copying what I've done and create your own solution.
Cheers
from chatcord.
What would the code look like to send messages to a specific user?
from chatcord.
Related Issues (20)
- MongoDB implementation
- saving the backend data and user messages . also adding the peer to peer camera functionalty
- css style and index.html not the same HOT 1
- css error HOT 3
- Issues while running my application HOT 2
- How to publish this to netlify? HOT 1
- Issue regarding time
- Prevent duplicate username in a chatroom HOT 1
- Someone copied the exact thing but just changed the css lmfao HOT 5
- Leave room button not working HOT 1
- deploying issue HOT 2
- TypeError: Cannot read property 'room' of undefined HOT 2
- there should be a notification for new messages. HOT 1
- file attachment HOT 1
- Submit Button HOT 3
- when to use socket.disconnect(0)?
- my port is not working HOT 1
- it is not an issue, how to deply this app to server HOT 3
- Error: connect ECONNREFUSED 127.0.0.1:6379 HOT 5
- Is it possible to add a password field so only people i register can use the app
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 chatcord.