RTCMultiConnection icon indicating copy to clipboard operation
RTCMultiConnection copied to clipboard

socket path option not working

Open yashdabi opened this issue 5 years ago • 1 comments

I have multiple projects in one IP so i have created sub path for each project. Example: http://myip.com/my-first-project

but when i add path option in socket it's not working server.js

const http = require('http');
const app = require('./app');
const RTCMultiConnectionServer = require('rtcmulticonnection-server');

const server = http.createServer(app);

// socket.io
let socketIO = require('socket.io')(server,{
path: '/my-first-project'
});
 socketIO.on('connection', (socket) => {
    RTCMultiConnectionServer.addSocket(socket);
  });

frontend.js

let connection  = new RTCMultiConnection();
connection.socketURL = 'http://myip.com/';
connection.socketOptions.path = '/my-first-project';

Solution i just checked in RTCMultiConnection.js connection.socketOptions is not added in try block

       try {
            connection.socket = io(connection.socketURL + parameters);
        } catch (e) {
            connection.socket = io.connect(connection.socketURL + parameters, connection.socketOptions);
        }

i just opened RTCMultiConnection.js and add connection.socketOptions in try block also

  try {
            connection.socket = io(connection.socketURL + parameters, connection.socketOptions);
        } catch (e) {
            connection.socket = io.connect(connection.socketURL + parameters, connection.socketOptions);
        }

please see into it and update RTCMultiConnection.js or provide me another solution for it

yashdabi avatar Jul 13 '20 06:07 yashdabi

Please accept @yashdabi solution or find another one. I am stuck with the same problem.

A-Ghattas avatar Nov 02 '20 11:11 A-Ghattas