500 Internal error

I wrote a javascript using socket.io to connect to Reach. Please see the code below

// SocketIO namespace:
namespace = "/test";

// initiate SocketIO connection
socket = io.connect("http://192.168.42.1" + namespace);

// say hello on connect
socket.on("connect", function () {
    socket.emit("browser connected", {data: "I'm connected"});
    $( "#popupDisconnected" ).popup( "close");
});

socket.on('disconnect', function(){
    console.log('disconnected');
    $( "#popupDisconnected" ).popup( "open");
});

When setting up the socket connection, it always returns 500 Internal Server Error.
GET http://192.168.42.1/socket.io/?EIO=3&transport=polling&t=LVkvHdx 500 (Internal Server Error)

When accessing 192.168.42.1 directly, there is no such an error.

Could you please help?

This only happens when the emlid reach rtk is rover mode. Everything seems fine when it is base mode. Any idea?