Discover Go and enrich concurrent programming skills by creating IRC server.
-
Only the Go standard library is allowed for this project.
-
You have to handle errors in a sensitive manner.
-
Write an IRC server using only the Go language.
-
The server should use concurrency and goroutines to handle multiple clients.
-
Users must be able to sign up on your server through a client with a unique username and password.
-
Users must also have a unique but modifiable nickname. However, usernames can- not change once they are created.
-
User information (nickname, username, and password) should be kept in-memory.
-
Channels are also stored in-memory.
-
If the server shuts down, all channel and user information must be wiped.
-
Your server must support the following commands:
8-1. PASS NICK USER - Initial authentication for a user.
8-2. NICK - Change nickname
8-3. JOIN - Makes the user join a channel. If the channel doesn’t exist, it will be created.
8-4. PART - Makes the user leave a channel.
8-5. NAMES - Lists all users connected to the server (bonus: make it RFC compliant with channel modes).
8-6. LIST - Lists all channels in the server (bonus: make it RFC compliant with channel modes).
8-7. PRIVMSG - Send a message to another user or a channel.\
-
RUN server: go run server.go & (keep in background)
-
Client: nc localhost 9000 (This server use port 9000)
-
Create 4 struct: Server, User, Channel, Msg.
-
Use
go handleConnection()
do concurrency. -
Save each user's connection to communicate with group or with other user.