Giter Club home page Giter Club logo

oimws's Introduction

OIMWS - OpenIM WebSocket Service ๐Ÿ˜Ž

Build Status Codecov Go Report Card GoDoc

๐ŸŽถ OIMWS (OpenIM WebSocket Service) is a high-performance, scalable WebSocket framework designed specifically for building instant messaging (IM) systems. Harnessing the concurrent capabilities of Go and the real-time communication provided by WebSocket protocol, OIMWS offers a robust backend solution to support modern instant communication needs, ranging from basic message transit to complex session management and network optimization.

Features ๐Ÿš€

  • WebSocket Support: Provides full WebSocket connection handling for high-concurrency client communication.
  • Modular Architecture: Features a set of decoupled modules for message processing, connection management, and user/group interactions, facilitating development and maintenance.
  • Real-Time Message Processing: Ensures swift response and distribution of real-time messages for timely and reliable communication.
  • Network Layer Abstraction: Includes low-level network abstractions allowing for customized protocol and data process flows.
  • Configuration Management: Simplified configuration management supports rapid deployment and environmental adaptation.
  • Utility Toolkit: Offers a wide array of utility functions for common operations such as date processing and text manipulation.
  • Automated Testing: Built-in unit tests ensure the stability of modules and features.
  • Clear Build Scripts: Makefile support simplifies the build process, enhancing developer productivity.
  • Code Quality Assurance: Integrates golangci-lint to ensure consistency in code quality and style.
  • Sample Code: Includes examples to demonstrate framework usage, use openim jssdk(10003) accelerating the learning curve for developers.

Quick Start ๐Ÿš—๐Ÿ’จ

Clone the repository to your local machine:

git clone https://github.com/openim-sigs/oimws.git
cd oimws

Build oimws

mage

Start oimws

mage start

Check oimws status

mage check

Stop oimws Status:

mage stop

An encapsulated framework within jssdk connecting to openim-sdk-core, providing streamlined management and integration of WebSocket, TCP, and HTTP protocols in the OpenIM ecosystem.

code

the folders of oimws:

cmd-------------- the main.go folder

common----------- common structures and functions, primarily used by the network frame

core_func-------- Some functions encapsulate the interface for calling the JS SDK.

gate------------- network frame,functions for websocket

module----------- the module codes

network---------- network frame

Cluster solution(Consistent Hashing)

Using consistent hashing in Nginx typically involves the hash directive within the upstream module. Starting from Nginx 1.7.2, it supports consistent hashing based on specified variables. You can use the request parameter sendId as the key for consistent hashing to distribute requests.

Here's a configuration example that demonstrates how to use consistent hashing for the /ws endpoint to select backend servers:

http {
    upstream backend {
        # Use userId as the key for consistent hashing
        hash $arg_sendId consistent;

        # Define backend servers
        server backend1.example.com;
        server backend2.example.com;
        # ... More backend servers ...
    }

    server {
        listen 80;

        location /ws {
            proxy_pass http://backend;
            # ... Other possible proxy settings ...
        }

        # ... Other location definitions ...
    }
}

Contribution โ“‚๏ธ

Feel free to contribute to this project by opening issues or submitting pull requests.

License ๐Ÿค

This project is licensed under the MIT License - see the LICENSE file for details.

oimws's People

Contributors

fgadvancer avatar cubxxw avatar luhaoling avatar withchao avatar bloomingg avatar dependabot[bot] avatar liumingsongning avatar xuexihuang avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.