Milestone Mobile SDK: Error 410/400 on WebSocket Connection when connecting to Partner-hosted Mobile Server from Web Client

While integrating the Milestone SDK on our side for video streaming, we’ve encountered some issues.

Architecture

  • Mobile server: Hosted in another environment (controlled by our partner client for whom we are integrating milestone in our product) other than our web client
  • Backend server: handling Connect & Login command and sending response to client
  • Client (Web): Using response from the backend client directly connects with Mobile server

Execution flow

  1. Client(web) asks backend to initiate a session with Mobile server
  2. Backend connects with Mobile server and sends Connect & Login command to start the streaming session and sends the response to Client
  3. Using response from backend server, now client directly connects with Mobile server and sends the initial commands “LiveMessage”, “Request Stream” and tries to initiate WebSocket connection for streaming.

We are yet to configure CORS on mobile server (as it is controlled by our partner client) for In our development environment we are bypassing CORS (disabling browser security). So, we are able to connect to mobile server and send commands(LiveMessage, RequestStream, etc.) to mobile server without CORS issue from Web.

When client(web) attempts to send few commands (as per the logic in SDK) to mobile server it works fine till it initiate WebSocket connection,

We get following errors,

- Error during WebSocket handshake: Unexpected response code: 410

- Error during WebSocket handshake: Unexpected response code: 400

We want to know, what can be the underlying issue here? is it related to missing configuration on Mobile server OR network configuration where mobile server is deployed?

Hello, can you change the settings for the API gateway on your client machine like stated in this guide so that we can esclude this from the list of the possible problems?

https://github.com/milestonesys/mipsdk-samples-protocol/tree/main/WebRTC_JavaScript#api-gateway-cors-settings

In case this doesn’t solve the problem can I ask you to add some additional information like the version of Xprotect installed from your client, and the version of the MIP SDK you are using, and maybe some additional logging information?