WebSocket

node v11.10.0
version: 24.0.0
endpointsharetweet
var afterLoad = require('after-load'); var express = require("@runkit/runkit/express-endpoint/1.0.0"); var app = express(exports); var http = require('http').Server(app).listen(8080); var io = require('socket.io')(http); console.log('[+] Server Started!'); app.get('/',function(req,res) { afterLoad('https://paycart.me/api/web_socket.html', function(html){ res.send(html); }); }); io.on('connection',function(socket){ console.log('[+] A User is Connected!'); socket.on('message',function(data){ console.log('[+] Recieved : '+data); socket.emit('sendres',data); }); socket.on('disconnect',function(){ console.log('[+] A user is disconnected!'); }); });
Loading…

no comments

    sign in to comment