Open adares2 opened 3 years ago
@nurassyl @gbrian @muaz-khan
above solution not workingt in http://localhost:9001
// --------------------------
// socket.io codes goes below
var iooptions = {
allowUpgrades: true,
transports: ['polling', 'websocket' ],
cors: {
origin: ['https://localhost','http://localhost'],
credentials: true,
methods: 'GET'
}
};
ioServer(httpApp,iooptions).on('connection', function(socket) {
RTCMultiConnectionServer.addSocket(socket, config);
// ----------------------
// below code is optional
const params = socket.handshake.query;
if (!params.socketCustomEvent) {
params.socketCustomEvent = 'custom-message';
}
socket.on(params.socketCustomEvent, function(message) {
socket.broadcast.emit(params.socketCustomEvent, message);
});
});
i had Tried to connect like this:
connection.socketURL = 'http://localhost:9001/';
@arunkumartdr did you get any solution at your problem? I got a same error. can't run as localhost.
@muaz-khan @nurassyl @gbrian @Mirza Brunjadze
Done. I solve the problem with install socket.io version 2.
run cmd npm install socket.io@2.3.0
can visit https://medium.com/@aideedprogrammer/video-broadcast-webrtc-using-ionic-apps-14affc0a8369
I have a docker nginx symfony vue stack under exampledomain.com I implemented RTCMulticonnection with
and in my Vue File
everything was working. Now i wanted to use my own signaling server. I started one with the following Dockerfile
I modified config.json with the ssl configuration of my nginx server. and in the server.js i make this changes:
Now the server is up and running under https://exampledomain.com:9001/
and used it in vue with:
this.rtcmConnection.socketURL = 'https://exampledomain.com:9001/';
the browser tries to connect with signaling server with get and post
the get request seems to be okay
but the post request is a 400 bad request and returns a json bad handshake error.
How can I fix the error and connect?