oimws

module
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2023 License: MIT

README

OpenIMProtocolFramework

Build Status Codecov Go Report Card GoDoc

🎶 Minimalist websocket framework for Go.

Melody is websocket framework based on github.com/gorilla/websocket that abstracts away the tedious parts of handling websockets. It gets out of your way so you can write real-time apps. Features include:

  • Clear and easy interface similar to net/http or Gin.
  • A simple way to broadcast to all or selected connected sessions.
  • Message buffers making concurrent writing safe.
  • Automatic handling of sending ping/pong heartbeats that timeout broken sessions.
  • Store data on sessions.

Install

go get github.com/openim-sigs/oimws

Build example

make build

Start example

make start

Example: chat

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.

Features

  • Protocol Management: Seamless management and integration of WebSocket, TCP, and HTTP protocols.
  • Encoding and Decoding: Handle message encoding and decoding for cross-language compatibility.
  • Protocol Implementation: Implement basic OpenIM protocols like login, push, etc.
  • Event Handling: Convert received messages into corresponding events and pass them to upper layer applications for processing.

Getting Started

Installation

Clone the repository to your local machine:

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

Import the necessary modules and initialize the protocol framework:

go
More examples

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL