Skip to content

Example of Socket.IO using Go, Gin, CORS, and the Document Object Model with support for multiple clients.

License

Notifications You must be signed in to change notification settings

Caknoooo/go-socket-io

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chat Application

This is a simple chat application built with Go and Socket.IO. It allows real-time communication between clients via WebSocket.

Todo: Integrated with database

Prerequisites

Before you begin, ensure you have the following installed:

Demo

Demo with multiple client https://sock.cakno.online/public/

2024-09-04.17-46-45.mp4

Demo with specific client (on branch -> chat-specific-user) https://specific-sock.cakno.online/public/

2024-09-04.17-54-31.mp4

Installation

  1. Clone the Repository:

    git clone https://github.com/Caknoooo/go-socket-io
    cd go-socket-io
  2. Install Dependencies Make sure you are in the project directory and run:

    go mod tidy

Running the Application

  1. Start the server To start the server, run:

    go run main.go
  2. Access the Application in a Browser: Open two or more browser tabs and navigate to:

    http://localhost:8222/public

    Each tab will act as a chat client. You can send messages from one tab and see them appear in the other tab in real-time.

Troubleshooting

  • Connection Issues: Ensure there are no network issues or firewall settings blocking the connection.
  • Dependency Errors: If you encounter dependency errors, make sure to run go mod tidy to update the modules.

About

Example of Socket.IO using Go, Gin, CORS, and the Document Object Model with support for multiple clients.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published