chat-socket
in Projects on Java, Socket, Javafx, Java-swing
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, multithreading, Java serialization, and JSON.
Installation
Download the binary file or clone this project and use your favorite IDE to customize then rebuild by:
- Run
install.bat
in scripts folder. mvn clean compile assembly:single
(the binary file will be placed in target folder)
This project requires jdk 1.8 or later.
Usage
Both server and client are in homechat.jar.
- Server app: run
server.bat
/server.sh
orjava -jar homechat.jar --mode=server
- Client app: run
client.bat
/client.sh
orjava -jar homechat.jar --mode=client
Server
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.
Client
- Connect to the server.
- Login to the system.
- Or register a new account.
- Other users will be shown in your friend list.
- To update your profile, double-click to the avatar.
- Double-click to any online friend to chat
Contributing
- 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
Dependencies
- common-lang3.
- java-json
- jackson
- commons-text
- commons-cli
- lombok
- log4j
- eventbus(desktop supported), original is here
- jdk 1.8
Author
Developed by sontx/noem, some useful information:
- Blog: https://sontx.dev
- Email: xuanson33bk@gmail.com
- Twitter: @sontx0