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("" + namespace);

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

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

When setting up the socket connection, it always returns 500 Internal Server Error.
GET 500 (Internal Server Error)

When accessing 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?