A project implementing load balancing using @socket.io/redis-adapter and Express as the server for handling HTTP requests and socket events.
This project aims to provide load balancing capabilities for socket.io applications using the @socket.io/redis-adapter package. It utilizes Express as the server to handle both HTTP requests and socket events.
- Load balancing of socket.io connections using @socket.io/redis-adapter
- Handling of HTTP requests using Express
- Handling of socket events using Express
-
Clone the repository:
git clone https://github.com/007tickooayush/bun-redis-socket.git
-
Install the dependencies:
bun install
-
Start the server:
bun run dev
-
Access the application in your browser at
http://localhost:3002
orhttp://localhost:3003
.
The following environment variables can be configured:
REDIS_URL
: The URL of the Redis server (default:redis://localhost:6379
)PORT
: The port on which the server should listen (default:3009
or3010
)
N/A