chat-socket is a simple chat application includes chat client and chat server. Support multiple users, private chat, and personal status. This project is based on TCP socket, multi-threading, JavaFx, Java Swing, Java serialization, and JSON.
To compile this project, you need to install these things:
Build (binary file will be placed in target directory):
mvn clean compile assembly:single
Run (will ask you for working mode):
mvn exec:java
Both server and client are in chatsocket-x.y-SNAPSHOT-jar-with-dependencies.jar (to get this jar file you need to build this project).
- Server app:
java -jar chatsocket.jar --mode=server
- Client app:
java -jar chatsocket.jar --mode=client
App settings will be saved in app.json file
{
"modified" : 1580791811962,
"settings" : [ {
"key" : "client",
"data" : {
"serverIp" : "127.0.0.1",
"serverPort" : 3393,
"loggedUserName" : "sontx"
}
}, {
"key" : "server",
"data" : {
"ip" : "127.0.0.1",
"port" : 3393
}
} ]
}
The server needs to listen to an IP and a port number, other clients will connect to this address. Fill up these boxes and click on Start button to start the server.
All users data will be saved in user.json file.
[ {
"id" : "7453f7f5105547179f0845cd03fe4eda",
"username" : "sontx",
"passwordHash" : "7c4a8d09ca3762af61e59520943dc26494f8941b",
"profile" : {
"displayName" : "Tran Xuan Son",
"status" : "I'm just a beginner"
}
} ]
- Connect to the server.
- Then login with your account
- Or register a new one.
- Other users will be shown in your friend list.
- To update your userProfile, double-click to the avatar.
- Double-click to any online friend to chat
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
Developed by sontx:
- Home: www.code4bugs.com
- Email: xuanson33bk@gmail.com
- Twitter: @sontx0