Skip to main content

OIMWS SDK Server User Guide

OIMWS SDK Server is a server-side program written in Go, designed to handle WebSocket connections and provide instant messaging services. This document aims to guide you through the installation and operation of OIMWS SDK Server, explaining its main features and parameter configurations.


You can install OIMWS SDK Server in two ways:

  1. Installation via Go Get: Run the following command in your terminal to install OIMWS SDK Server:

    go get
  2. Clone the GitHub Repository: Clone the OIMWS GitHub Repository to your local environment:

    git clone

    After doing so, please read the README file and execute the program in the example/ directory.


Before running OIMWS SDK Server, ensure it is correctly installed.

Running the program requires configuring some parameters, which you can set through command-line flags. Here is the main function of the program and its parameters:

func main() {
// Code omitted for clarity on parameter configuration
var sdkWsPort, logLevel *int
var openIMWsAddress, openIMApiAddress, openIMDbDir *string

// Parameter definitions and default values
openIMApiAddress = flag.String("openIM_api_address", "", "openIM api listening address")
openIMWsAddress = flag.String("openIM_ws_address", "ws://", "openIM ws listening address")
sdkWsPort = flag.Int("sdk_ws_port", 10003, "openIMSDK ws listening port")
logLevel = flag.Int("openIM_log_level", 5, "control log output level")
openIMDbDir = flag.String("openIMDbDir", "./db", "openIM db dir")


// Core logic code omitted

Parameter Explanation

  1. openIM_api_address: The listening address for the openIM API, default is
  2. openIM_ws_address: The WebSocket listening address for openIM, default is ws://
  3. sdk_ws_port: The listening port for openIMSDK WebSocket, default is 10003.
  4. openIM_log_level: The log output level, default is 5, which controls the verbosity of the logs.
  5. openIMDbDir: The directory for the openIM database, default is the ./db folder in the current directory.

Running Example

In the command line, you can modify these parameters by adding flags. For example:

./example -openIM_api_address="http://localhost:10002" -openIM_ws_address="ws://localhost:10001" -sdk_ws_port=10003 -openIM_log_level=4 -openIMDbDir="./data/db"

This will start the server and configure the service based on the provided parameters.


OIMWS SDK Server offers a flexible and powerful platform for handling instant messages and WebSocket connections. By following this guide, you should be able to successfully install and operate OIMWS SDK Server, as well as understand and configure its main parameters. For more advanced configurations and detailed information, refer to the project's GitHub page and related documentation.