High-availability domains

Update time: 2023/08/29 16:33:02

SDK Integration

The configuration item lbsBackupUrlsCustomer is added to initialization parameters, for example:

const nimIns = NIM.getInstance({
  appKey: 'appKey'
  account: 'account',
  token: 'token',
  // ....other initialization parameters
  lbsBackupUrlsCustomer: ['https://lbs-address1', 'https://lbs-address2']

The default lbs in CommsEase is https://lbs.netease.im/lbs/webconf.jsp. When the domain name is hijacked and lbsBackupUrlsCustomer exists, the SDK will attempt to get lbs content from the address to ensure login and integration of CommsEase IM.

**Note: url in **lbsBackupUrlsCustomer does not contain query parameters, because SDK will supplement such parameter automatically.


1. The custom address of LBS proxy service is set in SDK by the above method.

2. The SDK will supplement request parameters automatically after proxying LBS address and then send requests to lbs proxy service, in the following format https://lbs-address1.com?k=45c6af3c98409b18a84451215d0bdd6e&id=user01&sv=170&pv=1&networkType=0. The SDK will supplement the part that is after the question mark.

3. After receiving a request, the LBS proxy service will forward the request and related parameters to CommsEase LBS server. Example of forwarding a request by proxy: https://lbs.netease.im/lbs/webconf?k=45c6af3c98409b18a84451215d0bdd6e&id=user01&sv=170&pv=1&networkType=0.

4. CommsEase LBS server processes request and then returns application/json data.

5. LBS proxy server returns response data received from CommsEase to the client.

6. After receiving content, the client SDK will initiate IM connection and login.

Schematic diagram of lbs proxy

LBS proxy service is customized and realized by the user, without limitations in technology stack. There is only a need to ensure correct proxy o CommsEase LBS (https://lbs.netease.im/lbs/webconf) only.

Was this topic helpful?
  • SDK Integration
  • Procedure