mirror of
https://gitlab.com/comunic/nodejs-webrtcsignalexchangerserver
synced 2024-11-22 05:19:26 +00:00
29 lines
628 B
JavaScript
29 lines
628 B
JavaScript
/**
|
|
* Node Signal Exchanger test client
|
|
*
|
|
* @author Pierre HUBERT
|
|
*/
|
|
|
|
const Config = {
|
|
port: 8081,
|
|
server_name: "localhost",
|
|
clientID: location.href.toString().includes("#1") ? "client-1" : "client-2"
|
|
};
|
|
|
|
let client = new SignalExchangerClient(
|
|
Config.server_name,
|
|
Config.port,
|
|
Config.clientID
|
|
);
|
|
|
|
client.onConnected = function(){
|
|
console.log("Connected to signal exchanger server.");
|
|
}
|
|
|
|
client.onError = function() {
|
|
console.error("An error occurred with the connection to the signal exchanger server");
|
|
}
|
|
|
|
client.onClosed = function() {
|
|
console.log("Connection to server closed.");
|
|
} |