You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
782 B
33 lines
782 B
4 years ago
|
options = {
|
||
|
secure:true,
|
||
|
reconnect: true,
|
||
|
rejectUnauthorized : false
|
||
|
};
|
||
|
|
||
|
// Client
|
||
|
var io2 = require('socket.io-client');
|
||
|
var socket = io2.connect('http://localhost:8084', options);
|
||
|
//var socket = io2.connect('https://service.swarmlab.io:55583');
|
||
|
|
||
|
var msg2 = "hello";
|
||
|
socket.emit('pingServer', msg2);
|
||
|
|
||
|
|
||
|
|
||
|
//var socket = require('socket.io-client')('httpis://localhost:8099');
|
||
|
socket.on('connect', function(){
|
||
|
console.error('connect ...');
|
||
|
//socket.emit("adhoc", 'Hallo World!')
|
||
|
});
|
||
|
socket.on('customEmit', function(data){
|
||
|
console.error('customEmit '+data);
|
||
|
//socket.emit("adhoc", 'Hallo World!')
|
||
|
|
||
|
});
|
||
|
socket.on('disconnect', function(){
|
||
|
console.error('disconnect');
|
||
|
|
||
|
});
|
||
|
//socket.emit("adhoc", 'Hallo World!')
|
||
|
|